public void ShouldPassOnTheSameLogic() { // Arrange var collection = GetRandomCollection <string>(4, 7) .Distinct() .ToArray(); var seek = collection.Randomize().First(); // Pre-Assert // Act Assert.That(() => AssertionHelper.Expect( collection, AssertionHelper.Exactly(1).EqualTo(seek) ), Throws.Nothing ); Assert.That(() => Expectations.Expect( collection, Expectations.Exactly(1).EqualTo(seek) ), Throws.Nothing ); // Assert }
public void ShouldFailSimilarly() { // Arrange var collection = GetRandomCollection <string>(4, 7) .Distinct() .ToArray(); var seek = GetAnother <string>(collection); // Pre-Assert var ex1 = Assert.Throws <AssertionException>( () => AssertionHelper.Expect(collection, AssertionHelper.Exactly(1).EqualTo(seek)) ); var ex2 = Assert.Throws <AssertionException>( () => Expectations.Expect(collection, Expectations.Exactly(1).EqualTo(seek)) ); // Act // Assert Assert.That(ex1.Message, Is.EqualTo(ex1.Message)); Assert.That(ex1.Message, Is.EqualTo(ex2.Message)); }