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

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

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

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

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

                Assert.True(result);
            }