示例#1
0
        public void PrivatePropertyTest()
        {
            var t = new PropertyClass();

            var p2 = t.Reflection()
                     .Property("P2")
                     .SetValue(230)
                     .Property("P2")
                     .GetValue();

            var pi2 = t.Reflection()
                      .Property("P2")
                      .PropertyInfoType;

            var t2 = t.Reflection()
                     .Return();

            Assert.Equal(230, p2);
            Assert.Equal(t, t2);
            Assert.Equal("Int32", pi2.Name);
        }
示例#2
0
        public void PublicPropertyTest()
        {
            var t = new PropertyClass();

            var p1 = t.Reflection()
                     .Property(x => x.P1)
                     .SetValue("Foo")
                     .Property(x => x.P1)
                     .GetValue();

            var pi1 = t.Reflection()
                      .Property(x => x.P1)
                      .PropertyInfoType;

            var t2 = t.Reflection()
                     .Return();

            Assert.Equal("Foo", t.P1);
            Assert.Equal("Foo", p1);
            Assert.Equal(t, t2);
            Assert.Equal("String", pi1.Name);
        }