예제 #1
0
            public void NullCandidate_NoException()
            {
                var sut = new MockCommonSpecification <object>();

                var exception = Record.Exception(() => sut.IsNotSatisfiedBy(null, out _));

                Assert.Null(exception);
            }
예제 #2
0
            public void Nullable_ReturnTrue()
            {
                var sut = new MockCommonSpecification <int?>();

                var result = sut.IsNotSatisfiedBy(0);

                Assert.True(result);
            }
예제 #3
0
            public void IncorrectData_ReturnFalse <T>(T candidate)
            {
                var sut = new MockCommonSpecification <T>();

                var result = sut.IsNotSatisfiedBy(candidate);

                Assert.False(result);
            }
예제 #4
0
            public void IncorrectData_ReturnExpectedResultObject <T>(T candidate, SpecificationResult expected)
            {
                var sut = new MockCommonSpecification <T>();

                var overall = sut.IsNotSatisfiedBy(candidate, out var result);

                Assert.False(overall);
                Assert.Equal(expected, result, new SpecificationResultComparer());
            }
예제 #5
0
            public void Nullable_ReturnExpectedResultObject()
            {
                var expected = new SpecificationResult("NotMockCommonSpecification<Nullable<Int32>>");
                var sut      = new MockCommonSpecification <int?>();

                var overall = sut.IsNotSatisfiedBy(0, out var result);

                Assert.True(overall);
                Assert.Equal(expected, result, new SpecificationResultComparer());
            }