public virtual void Test013() { var xgr = new ExpressionGenerator(); var obj = new MethodCallTestData(); var obj1Expr = Expression.Lambda <Func <MethodCallTestData> >(Expression.Constant(obj, typeof(MethodCallTestData))); var obj2Expr = Expression.Lambda <Func <MethodCallTestData> >(Expression.Constant(obj, typeof(MethodCallTestData))); var expr1 = xgr.FromFunc(obj1Expr, obj1 => obj1.IntMethodOne()); var expr2 = xgr.FromFunc(obj2Expr, obj2 => obj2.IntMethodOne()); _assert.AreEqual(expr1, expr2); }
public virtual void Test016() { var xgr = new ExpressionGenerator(); MethodCallTestData obj1 = new MethodCallTestData(); MethodCallTestData obj2 = new MethodCallTestData(); var expr1 = xgr.FromFunc(() => obj1.IntMethodOne()); var expr2 = xgr.FromFunc(() => obj2.IntMethodOne()); // these aren't equal because the expressions (.NET 3.5 -> .nET 4.5.2+) are generated as a member access // on a constant over the invisible closure, instead of a constant reference to the objects themselves // TODO: Keep this up to date as new versions are released _assert.AreNotEqual(expr1, expr2); }
public virtual void Test016() { var xgr = new ExpressionGenerator(); MethodCallTestData obj1 = new MethodCallTestData(); MethodCallTestData obj2 = new MethodCallTestData(); var expr1 = xgr.FromFunc(() => obj1.IntMethodOne()); var expr2 = xgr.FromFunc(() => obj2.IntMethodOne()); // these aren't equal because the expressions (.NET 3.5 -> .nET 4.5.2+) are generated as a member access // on a constant over the invisible closure, instead of a constant reference to the objects themselves // TODO: Keep this up to date as new versions are released _assert.AreNotEqual(expr1, expr2); }
public virtual void Test015() { var xgr = new ExpressionGenerator(); var obj1 = new MethodCallTestData(); var obj2 = new MethodCallTestData(); var obj1Expr = Expression.Lambda<Func<MethodCallTestData>>(Expression.Constant(obj1, typeof(MethodCallTestData))); var obj2Expr = Expression.Lambda<Func<MethodCallTestData>>(Expression.Constant(obj2, typeof(MethodCallTestData))); var expr1 = xgr.FromFunc(obj1Expr, pobj1 => pobj1.IntMethodOne()); var expr2 = xgr.FromFunc(obj2Expr, pobj2 => pobj2.IntMethodOne()); _assert.AreNotEqual(expr1, expr2); }