public void VerifyWellBehavedEqualsNullOverrideDoesNotThrow() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNewObjectAssertion(dummyComposer); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(typeof(WellBehavedEqualsNewObjectOverride))); // Teardown }
public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNewObjectAssertion(dummyComposer); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(typeof(ClassThatDoesNotOverrideObjectEquals))); // Teardown }
public void VerifyNullMethodThrows() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNewObjectAssertion(dummyComposer); // Exercise system and verify outcome Assert.Throws<ArgumentNullException>(() => sut.Verify((MethodInfo)null)); // Teardown }
public void SutIsIdiomaticAssertion() { // Fixture setup var dummyComposer = new Fixture(); // Exercise system var sut = new EqualsNewObjectAssertion(dummyComposer); // Verify outcome Assert.IsAssignableFrom<IdiomaticAssertion>(sut); // Teardown }
public void ComposerIsCorrect() { // Fixture setup var expectedComposer = new Fixture(); var sut = new EqualsNewObjectAssertion(expectedComposer); // Exercise system ISpecimenBuilder result = sut.Builder; // Verify outcome Assert.Equal(expectedComposer, result); // Teardown }
public void VerifyIllbehavedEqualsNullBehaviourThrows() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNewObjectAssertion(dummyComposer); // Exercise system and verify outcome Assert.Throws<EqualsOverrideException>(() => sut.Verify(typeof(IllBehavedEqualsNewObjectOverride))); // Teardown }