Given a class, and a class I want to map to:
public class A
{
public string Prop1 { get; set; }
public string Prop2 { get; set; }
}
public class B
{
public string Prop1 { get; set; }
public string Prop2 { get; set; }
public string Prop3 { get; set; }
}
When I assert the result of the mapping, I'd want FluentAssertions to fail and warn me that 'Prop3' exists on B (the result), but not A.
But this won't happen if I use what seems to be the standard approach of using the result first:
b.Should().BeEquivalentTo(a); //passes because Prop3 is null, which doesn't exist on A
However if I flip the result and expectation around, I get the exact failure I'm after:
a.Should().BeEquivalentTo(b); //fails because of Prop3
I can't find any docs which use this ordering though. Is it an expected approach for those who have similar requirements, or is it hacking the library to get it to work how I want it?