In my NUnit/FluentAssertions tests I compare the complex object returned from my system with a reference one using the following code:
response.ShouldBeEquivalentTo(reference, o => o.Excluding(x => x.OrderStatus)
.Excluding(x => x.Id)
.Excluding(x => x.Items[0].Name)
.Excluding(x => x.Items[0].Article)
.Excluding(x => x.ResponseStatus));
However, this is not exactly what I intended. I'd like to exclude Name
and Article
for every object in Items
list and not only for the 0th. How do I implement this scenario?
I've looked through the documentation and din't find the solution. Am I missing something?