public void InvokeNull_NotRaiseException()
            {
                var sut = new MockCommonSpecification <object>();

                var exception = Record.Exception(() => sut.GetExpression().Compile().Invoke(null));

                Assert.Null(exception);
            }
            public void InvokeNullable_ReturnFalse()
            {
                var sut = new MockCommonSpecification <int?>();

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

                Assert.False(result);
            }
            public void InvokeIncorrectData_ReturnFalse <T>(T candidate)
            {
                var sut = new MockCommonSpecification <T>();

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

                Assert.False(result);
            }
Ejemplo n.º 4
0
            public void CastCorrectSpecification_ReturnExpression()
            {
                var sut = new MockCommonSpecification <object>();

                var expected = sut.GetExpression();
                var result   = (Expression)sut;

                Assert.Equal(expected.ToString(), result.ToString());
            }
            public void NonGenericILinqSpecification_ReturnExpressionAsAbstractExpression()
            {
                var sut = new MockCommonSpecification <object>();

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

                Assert.Equal(expected.ToString(), result.ToString());
            }