using System.Collections.Generic;
public static void Main()
Date = new DateTime(2022,11,01),
Customer = new Customer {
var anotherOrder = new Order {
Date = new DateTime(2022,11,01),
Customer = new Customer {
order.Should().BeEquivalentTo(anotherOrder, options =>
options.Excluding(o => o.Customer.Name);
options.Excluding(o => o.Customer.Id);
order.Should().BeEquivalentTo(anotherOrder, options =>
options.Excluding(o => o.Customer.Name);
options.Excluding(o => o.Customer.Id);
order.Should().BeEquivalentTo(anotherOrder, options =>
options.Excluding(o => o.Customer.Name)
.Excluding(o => o.Customer.Id)
order.Should().BeEquivalentTo(anotherOrder);
catch(Exception ex) { Console.WriteLine(ex); }
order.Should().BeEquivalentTo(anotherOrder, options =>
options.Excluding(o => o.Customer);
options.Including(o => o.Customer.Name);
Console.WriteLine("Fluent Assertions Collection extension methods tests - pass");
public int Id { get;set;}
public DateTime Date { get;set;}
public Customer Customer { get;set; }
public int Id { get;set;}
public string Name { get;set; }