public void InvokeInvalidCandidate_ReturnFalse(string candidate, string expected)
            {
                var sut = new ContainsSpecification(expected);

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

                Assert.False(result);
            }
Ejemplo n.º 2
0
            public void InvokeNullCollectionLinqToEntities_Exception()
            {
                var sut       = new ContainsSpecification <int[], int>(0, null, true);
                var exception = Record.Exception(() => sut.GetNegationExpression().Compile().Invoke(null));

                Assert.NotNull(exception);
                Assert.IsType <ArgumentNullException>(exception);
            }
Ejemplo n.º 3
0
            public void InvokeContainsChildTypeElement_ReturnFalse()
            {
                var expected  = new ComparableFakeType();
                var candidate = new[] { new FakeType(), expected, null };
                var sut       = new ContainsSpecification <FakeType[], FakeType>(expected);

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

                Assert.False(result);
            }
Ejemplo n.º 4
0
            public void InvokeNotContainsElementsValid_ReturnTrue <T, TType>(T candidate, TType expected,
                                                                             IEqualityComparer <TType> comparer)
                where T : IEnumerable <TType>
            {
                expected = expected?.ToString() != "null" ? expected : default;
                var sut = new ContainsSpecification <T, TType>(expected, comparer);

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

                Assert.True(result);
            }