コード例 #1
0
        public void VerifyWellBehavedEqualityComparerDoesNotThrow()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualityComparerAssertion(dummyComposer);

            // Act & Assert
            Assert.Null(Record.Exception(() =>
                                         sut.Verify(typeof(WellBehavedEqualityComparer))));
        }
コード例 #2
0
        public void VerifyIllBehavedSelfEqualityComparerThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualityComparerAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <EqualityComparerImplementationException>(() =>
                                                                    sut.Verify(typeof(IllBehavedSelfEqualityComparer)));
        }
コード例 #3
0
        public void VerifyNullMethodThrows()
        {
            // Arrange
            var dummyComposer = new Fixture();
            var sut           = new EqualityComparerAssertion(dummyComposer);

            // Act & Assert
            Assert.Throws <ArgumentNullException>(() =>
                                                  sut.Verify((MethodInfo)null));
        }
コード例 #4
0
 public void EqualityComparer_is_correctly_implemented(Type type, EqualityComparerAssertion assertion) => assertion.Verify(type);