예제 #1
0
        public void TestCastImplecit()
        {
            //Assert.AreEqual (true, (bool)new Simple ());
            Assert.AreEqual(true, ReflectionUtil.Cast(typeof(bool), new Simple()));

            Simple s = ReflectionUtil.Cast(typeof(Simple), 4) as Simple;

            Assert.AreEqual(4, s._a);
        }
예제 #2
0
 public void TestCastNumber()
 {
     Assert.AreEqual(typeof(float), ReflectionUtil.Cast(typeof(float), 3).GetType());
     Assert.AreEqual(typeof(int), ReflectionUtil.Cast(typeof(int), 3.4).GetType());
     Assert.AreEqual(3, ReflectionUtil.Cast(typeof(int), 3.4));
 }