コード例 #1
0
 public void VerifyWellBehavedEqualsSelfOverrideDoesNotThrow()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new EqualsSelfAssertion(dummyComposer);
     // Exercise system and verify outcome
     Assert.DoesNotThrow(() =>
         sut.Verify(typeof(WellBehavedEqualsSelfObjectOverride)));
     // Teardown            
 }
コード例 #2
0
 public void VerifyClassThatDoesNotOverrideObjectEqualsDoesNothing()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new EqualsSelfAssertion(dummyComposer);
     // Exercise system and verify outcome
     Assert.DoesNotThrow(() =>
         sut.Verify(typeof(ClassThatDoesNotOverrideObjectEquals)));
     // Teardown
 }
コード例 #3
0
 public void VerifyNullMethodThrows()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new EqualsSelfAssertion(dummyComposer);
     // Exercise system and verify outcome
     Assert.Throws<ArgumentNullException>(() =>
         sut.Verify((MethodInfo)null));
     // Teardown
 }
コード例 #4
0
 public void SutIsIdiomaticAssertion()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     // Exercise system
     var sut = new EqualsSelfAssertion(dummyComposer);
     // Verify outcome
     Assert.IsAssignableFrom<IdiomaticAssertion>(sut);
     // Teardown
 }
コード例 #5
0
 public void ComposerIsCorrect()
 {
     // Fixture setup
     var expectedComposer = new Fixture();
     var sut = new EqualsSelfAssertion(expectedComposer);
     // Exercise system
     ISpecimenBuilder result = sut.Builder;
     // Verify outcome
     Assert.Equal(expectedComposer, result);
     // Teardown
 }
コード例 #6
0
 public void VerifyIllbehavedEqualsSelfBehaviourThrows()
 {
     // Fixture setup
     var dummyComposer = new Fixture();
     var sut = new EqualsSelfAssertion(dummyComposer);
     // Exercise system and verify outcome
     Assert.Throws<EqualsOverrideException>(() =>
         sut.Verify(typeof(IllBehavedEqualsSelfObjectOverride)));
     // Teardown
 }