Skip to content

Commit

Permalink
Draft styled comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
nscheibe committed Aug 27, 2021
1 parent edc56a6 commit a9cbecf
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/Snapshooter/MatchOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public IEnumerable<FieldMatchOperator> MatchOperators
/// <summary>
/// The <see cref="IgnoreField(string)"/> option ignores the existing field(s) by the given
/// json path. The field(s) will be ignored during snapshot comparison.
///
/// Example:
/// </summary>
/// <example>
/// <code>
/// {
/// "UserId": "0A332E69-FDDB-46B9-8E42-C411C3F633AC",
/// "Firstname": "David",
Expand All @@ -57,21 +58,25 @@ public IEnumerable<FieldMatchOperator> MatchOperators
/// },
/// ]
/// }
///
/// Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Firstname"))
/// >> This will ignore the 'Firstname' field in the root element. ('David')
///
/// Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Relatives[0].Firstname"))
/// >> This will ignore the first 'Firstname' field of the Relatives element. ('Mark')
///
/// Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Relatives[*].Firstname"))
/// >> This will ignore all 'Firstname' fields of the Relatives element. ('Mark' and 'Jenny')
///
/// To ignore all fields of a specific name, use the syntax '**.fieldName'
/// Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("**.Firstname"))
/// >> This will ignore all 'Firstname' fields of the entire json. ('David', 'Mark' and 'Jenny')
///
/// </summary>
/// </code>
/// <para>
/// <c>Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Firstname"))</c>
/// - This will ignore the 'Firstname' field in the root element. ('David')
/// </para>
/// <para>
/// <c>Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Relatives[0].Firstname"))</c>
/// - This will ignore the first 'Firstname' field of the Relatives element. ('Mark')
/// </para>
/// <para>
/// <c>Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("Relatives[*].Firstname"))</c>
/// - This will ignore all 'Firstname' fields of the Relatives element. ('Mark' and 'Jenny')
/// </para>
/// <para>
/// To ignore all fields of a specific name, use the syntax '**.fieldName'
/// <c>Snapshot.Match(userDavidWalton, matchOptions => matchOptions.IgnoreField("**.Firstname"))</c>
/// - This will ignore all 'Firstname' fields of the entire json. ('David', 'Mark' and 'Jenny')
/// </para>
/// </example>
/// <param name="fieldPath">The json path to the field(s) to ignore.</param>
public MatchOptions IgnoreField(string fieldPath)
{
Expand Down

0 comments on commit a9cbecf

Please sign in to comment.