Esempio n. 1
0
            public void NullCollectionLinqToEntities_Exception()
            {
                var sut       = new LengthSpecification <int[]>(0, true);
                var exception = Record.Exception(() => sut.IsNotSatisfiedBy(null));

                Assert.NotNull(exception);
                Assert.IsType <ArgumentNullException>(exception);
            }
Esempio n. 2
0
            public void InvalidCandidate_ReturnFalse <T>(T candidate, int length)
                where T : IEnumerable
            {
                var sut = new LengthSpecification <T>(length);

                var result = sut.IsNotSatisfiedBy(candidate);

                Assert.False(result);
            }
Esempio n. 3
0
            public void ValidCandidate_ReturnTrue <T>(T candidate, int length)
                where T : IEnumerable
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new LengthSpecification <T>(length);

                var result = sut.IsNotSatisfiedBy(candidate);

                Assert.True(result);
            }
Esempio n. 4
0
            public void InvalidCandidate_ReturnExpectedResultObject <T>(T candidate, int length,
                                                                        SpecificationResult expected)
                where T : IEnumerable
            {
                var sut = new LengthSpecification <T>(length);

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

                Assert.False(overall);
                Assert.Equal(expected, result, new SpecificationResultComparer());
            }
Esempio n. 5
0
            public void ValidCandidate_ReturnExpectedResultObject <T>(T candidate, int length,
                                                                      SpecificationResult expected)
                where T : IEnumerable
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new LengthSpecification <T>(length);

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

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