コード例 #1
0
        public void FieldStatic()
        {
            MemberAssignment expr = Expression.Bind(MemberClass.GetStaticFieldInfo(), Expression.Constant(1));

            Assert.AreEqual(MemberBindingType.Assignment, expr.BindingType, "Bind#05");
            Assert.AreEqual("StaticField = 1", expr.ToString(), "Bind#06");
        }
コード例 #2
0
ファイル: ExpressionTest_Field.cs プロジェクト: lin5/Theraot
        public void StaticField2()
        {
            var expr = Expression.Field(null, MemberClass.GetStaticFieldInfo());

            Assert.AreEqual(ExpressionType.MemberAccess, expr.NodeType, "Field#07");
            Assert.AreEqual(typeof(int), expr.Type, "Field#08");
            Assert.AreEqual("MemberClass.StaticField", expr.ToString(), "Field#09");
        }