public void PropertyRw() { MemberAssignment expr = Expression.Bind(MemberClass.GetRwPropertyInfo(), Expression.Constant(1)); Assert.AreEqual(MemberBindingType.Assignment, expr.BindingType, "Bind#07"); Assert.AreEqual("TestProperty2 = 1", expr.ToString(), "Bind#08"); }
public void PropertyAccessor() { MethodInfo mi = typeof(MemberClass).GetMethod("get_TestProperty2"); MemberAssignment expr = Expression.Bind(mi, Expression.Constant(1)); Assert.AreEqual(MemberBindingType.Assignment, expr.BindingType, "Bind#11"); Assert.AreEqual("TestProperty2 = 1", expr.ToString(), "Bind#12"); Assert.AreEqual(MemberClass.GetRwPropertyInfo(), expr.Member, "Bind#13"); }