public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNullAssertion(dummyComposer); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(typeof(ClassThatDoesNotOverrideObjectEquals))); // Teardown }
public void VerifyWellBehavedEqualsNullOverrideDoesNotThrow() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNullAssertion(dummyComposer); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(typeof(WellBehavedEqualsNullOverride))); // Teardown }
public void VerifyNullMethodThrows() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNullAssertion(dummyComposer); // Exercise system and verify outcome Assert.Throws<ArgumentNullException>(() => sut.Verify((MethodInfo)null)); // Teardown }
public void VerifyAnonymousMethodWithNoDeclaringOrReflectedTypeDoesNothing() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNullAssertion(dummyComposer); var method = (MethodInfo)(new MethodInfoWithNullDeclaringAndReflectedType()); // Exercise system and verify outcome Assert.DoesNotThrow(() => sut.Verify(method)); // Teardown }
public void VerifyIllbehavedEqualsNullBehaviourThrows() { // Fixture setup var dummyComposer = new Fixture(); var sut = new EqualsNullAssertion(dummyComposer); // Exercise system and verify outcome Assert.Throws<EqualsOverrideException>(() => sut.Verify(typeof(IllbehavedEqualsNullOverride))); // Teardown }