I'm sure i'm missing the obvious...
Say we have:
public class MyObject
{
public string SomeProp { get; set; }
public int AnotherProp { get; set; }
}
[Fact]
public void SomeTest()
{
var a = new MyObject { SomeProp = "hello", AnotherProp = 9 };
var b = new MyObject { SomeProp = "hello" };
var c = new MyObject { AnotherProp = 9 };
var d = new MyObject { SomeProp = "hello", AnotherProp = 9 };
}
What is the correct assertion to check that all of the properties match (e.g. a
and d
would return true, but all other combinations would return false?
At the moment, i'm doing equivalency checks, but have to do it in both directions? e.g.
a.Should().BeEquivalentTo(d);
d.Should().BeEquivalentTo(a);
Forgive me if this is clearly defined in the docs... I can't find it :/