示例#1
0
            public void InvokeNullCollectionLinqToEntities_Exception()
            {
                var sut       = new MaxLengthSpecification <int[]>(0, true);
                var exception = Record.Exception(() => sut.GetNegationExpression().Compile().Invoke(null));

                Assert.NotNull(exception);
                Assert.IsType <ArgumentNullException>(exception);
            }
示例#2
0
            public void InvokeInvalidCandidate_ReturnFalse <T>(T candidate, int maxLength)
                where T : IEnumerable
            {
                var sut = new MaxLengthSpecification <T>(maxLength);

                var result = sut.GetNegationExpression().Compile().Invoke(candidate);

                Assert.False(result);
            }
示例#3
0
            public void InvokeValidCandidate_ReturnTrue <T>(T candidate, int maxLength)
                where T : IEnumerable
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new MaxLengthSpecification <T>(maxLength);

                var result = sut.GetNegationExpression().Compile().Invoke(candidate);

                Assert.True(result);
            }