public void Method2() { Assert.Throws <ArgumentException>(() => { // This tests the MemberInfo version of Bind(): should raise an exception // because the argument is not a field or property accessor. Expression.Bind((MemberInfo)MemberClass.GetMethodInfo(), Expression.Constant(1)); }); }
public void Method1() { // This tests the MethodInfo version of Bind(): should raise an exception // because the method is not an accessor. Expression.Bind(MemberClass.GetMethodInfo(), Expression.Constant(1)); }