コード例 #1
0
        public void IsUnknownNonExtensionExpression()
        {
            var unknownExpression = new UnknownExpression(typeof(int));

            Assert.That(ExpressionTreeVisitor.IsUnknownNonExtensionExpression(unknownExpression), Is.True);

            var standardExpression = Expression.Constant(0);

            Assert.That(ExpressionTreeVisitor.IsUnknownNonExtensionExpression(standardExpression), Is.False);

            var extensionExpression = new TestExtensionExpression(Expression.Constant(0));

            Assert.That(ExpressionTreeVisitor.IsUnknownNonExtensionExpression(extensionExpression), Is.False);

            var querySourceReferenceExpression = new QuerySourceReferenceExpression(ExpressionHelper.CreateMainFromClause_Int());

            Assert.That(ExpressionTreeVisitor.IsUnknownNonExtensionExpression(querySourceReferenceExpression), Is.False);

            var subQueryExpression = new SubQueryExpression(ExpressionHelper.CreateQueryModel <Cook> ());

            Assert.That(ExpressionTreeVisitor.IsUnknownNonExtensionExpression(subQueryExpression), Is.False);
        }