本文整理汇总了C#中ExpressionGenerator.Join方法的典型用法代码示例。如果您正苦于以下问题:C# ExpressionGenerator.Join方法的具体用法?C# ExpressionGenerator.Join怎么用?C# ExpressionGenerator.Join使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExpressionGenerator
的用法示例。
在下文中一共展示了ExpressionGenerator.Join方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test051
public void Test051()
{
var xgr = new ExpressionGenerator();
Func<Expression, BinaryExpression> conv = x => (BinaryExpression)x;
var el = new Expression[] {
Expression.Default(typeof(decimal)),
Expression.Default(typeof(decimal))
};
var result = xgr.Join<decimal>(el, ExpressionType.Add);
Assert.IsInstanceOfType(result.Body, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, result.Body.NodeType);
Assert.AreEqual(el[0], conv(result.Body).Left);
Assert.AreEqual(el[1], conv(result.Body).Right);
}
示例2: Test048
public void Test048()
{
var xgr = new ExpressionGenerator();
Func<Expression, BinaryExpression> conv = x => (BinaryExpression)x;
var result = xgr.Join(null, ExpressionType.Add);
Assert.IsNull(result);
}
示例3: Test049
public void Test049()
{
var xgr = new ExpressionGenerator();
Func<Expression, BinaryExpression> conv = x => (BinaryExpression)x;
var el = new Expression[] {
Expression.Default(typeof(int))
};
var result = xgr.Join(el, ExpressionType.Add);
Assert.AreEqual(el[0], result);
}
示例4: Test046
public void Test046()
{
var xgr = new ExpressionGenerator();
Func<Expression, BinaryExpression> conv = x => (BinaryExpression)x;
var el = new Expression[] {
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
Expression.Default(typeof(int)),
};
var result = xgr.Join(el, ExpressionType.Add);
Assert.IsInstanceOfType(result, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, result.NodeType);
Assert.IsInstanceOfType(conv(result).Left, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(result).Left.NodeType);
Assert.IsInstanceOfType(conv(conv(result).Left).Left, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(conv(result).Left).Left.NodeType);
Assert.AreEqual(el[0], conv(conv(conv(result).Left).Left).Left);
Assert.AreEqual(el[1], conv(conv(conv(result).Left).Left).Right);
Assert.IsInstanceOfType(conv(conv(result).Left).Right, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(conv(result).Left).Right.NodeType);
Assert.AreEqual(el[2], conv(conv(conv(result).Left).Right).Left);
Assert.AreEqual(el[3], conv(conv(conv(result).Left).Right).Right);
Assert.IsInstanceOfType(conv(result).Right, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(result).Right.NodeType);
Assert.IsInstanceOfType(conv(conv(result).Right).Left, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(conv(result).Right).Left.NodeType);
Assert.AreEqual(el[4], conv(conv(conv(result).Right).Left).Left);
Assert.AreEqual(el[5], conv(conv(conv(result).Right).Left).Right);
Assert.IsInstanceOfType(conv(conv(result).Right).Right, typeof(BinaryExpression));
Assert.AreEqual(ExpressionType.Add, conv(conv(result).Right).Right.NodeType);
Assert.AreEqual(el[6], conv(conv(conv(result).Right).Right).Left);
Assert.AreEqual(el[7], conv(conv(conv(result).Right).Right).Right);
}