Пример #1
0
            public void InvokeNullableCandidate_ReturnFalse(int?candidate, int?expected)
            {
                var sut = new EqualSpecification <int?>(expected);

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

                Assert.False(result);
            }
Пример #2
0
            public void InvokeNotEqualCandidate_ReturnFalse <T>(T candidate, T expected, IEqualityComparer <T> comparer)
            {
                candidate = candidate?.ToString() != "null" ? candidate : default;
                var sut = new EqualSpecification <T>(expected, comparer);

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

                Assert.False(result);
            }
Пример #3
0
            public void NonGenericILinqSpecification_ReturnExpressionAsAbstractExpression()
            {
                var sut = new EqualSpecification <string>(null);

                var expected      = sut.GetExpression().ToString();
                var sutExpression = ((ILinqSpecification)sut).GetExpression();
                var result        = sutExpression.ToString();

                Assert.Equal(expected, result);
            }