Exemple #1
0
        public static void TestGetValue14()
        {
            string       propertyName = "Property2";
            Object       obj          = new LaterClass();
            PropertyInfo pi           = GetProperty(typeof(LaterClass), propertyName);


            Assert.Equal(pi.Name, propertyName);

            int value = (int)pi.GetValue(obj);

            Assert.Equal(value, 100);
        }
Exemple #2
0
        public static void TestGetValue13()
        {
            string       propertyName = "Property1";
            Object       obj          = new LaterClass();
            PropertyInfo pi           = GetProperty(typeof(LaterClass), propertyName);


            Assert.Equal(pi.Name, propertyName);

            Assert.Throws <ArgumentException>(() =>
            {
                var value = pi.GetValue(obj, null);;
            });
        }
        public static void TestGetValue14()
        {
            string propertyName = "Property2";
            Object obj = new LaterClass();
            PropertyInfo pi = GetProperty(typeof(LaterClass), propertyName);


            Assert.Equal(pi.Name, propertyName);

            int value = (int)pi.GetValue(obj);

            Assert.Equal(value, 100);
        }
        public static void TestGetValue13()
        {
            string propertyName = "Property1";
            Object obj = new LaterClass();
            PropertyInfo pi = GetProperty(typeof(LaterClass), propertyName);


            Assert.Equal(pi.Name, propertyName);

            Assert.Throws<ArgumentException>(() =>
            {
                var value = pi.GetValue(obj, null); ;
            });
        }