예제 #1
0
        public void Traverse2_Field_Static()
        {
            var instance = new Traverse2_BaseClass();

            var trv1 = Traverse2.Create(instance).Field("staticField");

            Assert.AreEqual("test1", trv1.GetValue());


            var trv2 = Traverse2.Create(typeof(Traverse2Fields_Static)).Field("staticField");

            Assert.AreEqual("test2", trv2.GetValue());
        }
예제 #2
0
        public void Traverse2_Property_Static()
        {
            var instance = new Traverse2_BaseClass();

            var trv1 = Traverse2.Create(instance).Property("StaticProperty");

            Assert.AreEqual("test1", trv1.GetValue());


            var trv2 = Traverse2.Create(typeof(Traverse2Properties_Static)).Property("StaticProperty");

            Assert.AreEqual("test2", trv2.GetValue());
        }