Skip to content

Commit

Permalink
Improve documentation on ExcludingNestedObjects (#2211)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisdoomen committed May 31, 2023
1 parent 672bd56 commit cd88618
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,24 @@ public Restriction<TProperty> Using<TProperty>(Action<IAssertionContext<TPropert
}

/// <summary>
/// Causes the structural equality check to include nested collections and complex types.
/// Causes the structural equality comparison to recursively traverse the object graph and compare the fields and
/// properties of any nested objects and objects in collections.
/// </summary>
/// <remarks>
/// This is the default behavior. You can override this using <see cref="ExcludingNestedObjects"/>.
/// </remarks>
public TSelf IncludingNestedObjects()
{
isRecursive = true;
return (TSelf)this;
}

/// <summary>
/// Causes the structural equality check to exclude nested collections and complex types.
/// Stops the structural equality check from recursively comparing the members any nested objects.
/// </summary>
/// <remarks>
/// Behaves similarly to the old property assertions API.
/// If a property or field points to a complex type or collection, a simple <see cref="object.Equals(object)"/> call will
/// be done instead of recursively looking at the properties or fields of the nested object.
/// </remarks>
public TSelf ExcludingNestedObjects()
{
Expand Down

0 comments on commit cd88618

Please sign in to comment.