public void CallZeroParameterInstanceMethod() { var instance = new ClassWithMethods(); Expression<Action> lambda = () => instance.ZeroParameterInstanceMethod(); var methodCallExpression = (MethodCallExpression)lambda.Body; AssertEquals(methodCallExpression.Method.Name, "ZeroParameterInstanceMethod"); var target = (ConstantExpression)methodCallExpression.Object; AssertEquals(target.Value, instance); }
public void CallZeroParameterInstanceMethod() { var instance = new ClassWithMethods(); Expression <Action> lambda = () => instance.ZeroParameterInstanceMethod(); var methodCallExpression = (MethodCallExpression)lambda.Body; QUnit.AreEqual(methodCallExpression.Method.Name, "ZeroParameterInstanceMethod"); var target = (ConstantExpression)methodCallExpression.Object; QUnit.AreEqual(target.Value, instance); }