I just start to use Moq & FluentAssertions and find this:
results.Results.Count.Should().Equals(1);
in the code, results.Results return a list of class List. In the test setup, I set it as results.Results.Count = 3 (I can see this # is correct in debug too). But somehow, the above .Equals test passed. Then I changed it to
results.Results.Count.Should().Equals("1");
It still passed. It will fail if I use
results.Results.Count.ShouldBeEquivalentTo(1);
So, the question is:
what results.Results.Count.Should().Equals("1") compare? why it passed?
Thanks
.Should()
is a part ofMoq
. EDIT: yea, i can't find it in the documentation – Below