Ejemplo n.º 1
0
 public void TestWoopsaReflectionIsWoopsaType()
 {
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(bool)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(int)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(double)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(DateTime)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(TimeSpan)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(string)));
     Assert.IsTrue(WoopsaReflection.IsWoopsaValueType(null, typeof(TypeCode)));
     Assert.IsFalse(WoopsaReflection.IsWoopsaValueType(null, typeof(List <int>)));
 }
Ejemplo n.º 2
0
 public TypeDescription GetTypeDescription(Type type)
 {
     if (type != null)
     {
         if (!_typeDescriptions.TryGetValue(type, out TypeDescription result))
         {
             result = WoopsaReflection.ReflectType(type, CustomTypeConverters);
             _typeDescriptions[type] = result;
         }
         return(result);
     }
     else
     {
         return(null);
     }
 }