samedi 19 décembre 2015

Use of `ShouldBeEquivalentTo`, `ShouldAllBeEquivalentTo`, and `BeEquivalentTo`

I am working with fluent assertions in my unit tests, however the use of ShouldBeEquivalentTo, ShouldAllBeEquivalentTo, and BeEquivalentTo is unclear.

For example; all the following statements pass so the functions appear equivalent.

List<string> a = new List<string>() { "james", "wood" };
List<string> b = new List<string>() { "james", "wood" };

a.ShouldBeEquivalentTo(b);
a.ShouldAllBeEquivalentTo(b);
a.Should().BeEquivalentTo(b);

Why should I use one rather than the another?

Aucun commentaire:

Enregistrer un commentaire