コード例 #1
0
            public void NullableCandidate_ReturnFalse(int?candidate, int?lessThan)
            {
                var sut = new LessThanSpecification <int?>(lessThan);

                var result = sut.IsNotSatisfiedBy(candidate);

                Assert.False(result);
            }
コード例 #2
0
            public void LessThanCandidate_ReturnFalse <T>(T candidate, T lessThan, IComparer <T> comparer)
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new LessThanSpecification <T>(lessThan, comparer);

                var result = sut.IsNotSatisfiedBy(candidate);

                Assert.False(result);
            }
コード例 #3
0
            public void CorrectNullableCandidate_ReturnExpectedResultObject(int?candidate, int?lessThan,
                                                                            SpecificationResult expected)
            {
                var sut = new LessThanSpecification <int?>(lessThan);

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

                Assert.True(overall);
                Assert.Equal(expected, result, new SpecificationResultComparer());
            }
コード例 #4
0
            public void LessThanCandidate_ReturnExpectedResultObject <T>(T candidate, T lessThan, IComparer <T> comparer,
                                                                         SpecificationResult expected)
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new LessThanSpecification <T>(lessThan, comparer);

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

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