Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation on ExcludingNestedObjects #2211

Merged
merged 1 commit into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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