Esempio n. 1
0
        public void InlinePropertyReflection()
        {
            var invoker = new ReflectionInvoker(typeof(TestClass), "Group.Struct.Width");
            var width   = (int)invoker.GetValue(testReference);

            Assert.AreEqual(value, width, "Reflection Fail Get Operation");
            invoker.SetValue(testReference, width + 1);
            Assert.AreEqual(value + 1, testReference.Group.Struct.Width, "Reflection Fail Set Operation");
        }
Esempio n. 2
0
        public void PropertyReflection()
        {
            var invoker = new ReflectionInvoker(typeof(TestClass), "X");
            var x       = (int)invoker.GetValue(testReference);

            Assert.AreEqual(value, x, "Reflection Fail Get Operation");
            invoker.SetValue(testReference, x + 1);
            Assert.AreEqual(value + 1, testReference.X, "Reflection Fail Set Operation");
        }
Esempio n. 3
0
        public void InlineFieldReflection()
        {
            var invoker = new ReflectionInvoker(typeof(TestClass), "Struct.Field");
            var x       = (int)invoker.GetValue(testReference);

            Assert.AreEqual(value, x, "Reflection Fail Get Operation");
            x++;
            invoker.SetValue(testReference, x);
            Assert.AreEqual(value + 1, testReference.Struct.Field, "Reflection Fail Set Operation");
        }