Beispiel #1
0
        public void InstanceProperty2()
        {
            var expr = Expression.Property(Expression.Constant(new MemberClass()), MemberClass.GetRoPropertyInfo());

            Assert.AreEqual(ExpressionType.MemberAccess, expr.NodeType, "Property#04");
            Assert.AreEqual(typeof(int), expr.Type, "Property#05");
            Assert.AreEqual("value(MonoTests.System.Linq.Expressions.MemberClass).TestProperty1", expr.ToString(), "Property#06");
        }
        public void InstanceProperty3()
        {
            MethodInfo mi = typeof(MemberClass).GetMethod("get_TestProperty1");

            MemberExpression expr = Expression.Property(Expression.Constant(new MemberClass()), mi);

            Assert.AreEqual(ExpressionType.MemberAccess, expr.NodeType, "Property#07");
            Assert.AreEqual(typeof(int), expr.Type, "Property#08");
            Assert.AreEqual("value(MonoTests.System.Linq.Expressions.MemberClass).TestProperty1", expr.ToString(), "Property#09");
            Assert.AreEqual(MemberClass.GetRoPropertyInfo(), expr.Member, "Property#10");
        }
 public void PropertyRo()
 {
     Expression.Bind(MemberClass.GetRoPropertyInfo(), Expression.Constant(1));
 }
Beispiel #4
0
 public void PropertyRo()
 {
     Assert.Throws <ArgumentException>(() => { Expression.Bind(MemberClass.GetRoPropertyInfo(), Expression.Constant(1)); });
 }