public static Type GetType(this Assembly assembly, string name, bool throwOnError)
 {
     Type[] types = AssemblyExtensions.GetTypes(assembly);
     for (int index = 0; index < types.Length; ++index)
     {
         if (types[index].Name == name)
         {
             return(types[index]);
         }
     }
     if (throwOnError)
     {
         throw new Exception("Type " + name + " was not found");
     }
     else
     {
         return((Type)null);
     }
 }
Beispiel #2
0
        public void GetTypes()
        {
            Assembly executingAssembly = GetType().GetTypeInfo().Assembly;

            Assert.True(AssemblyExtensions.GetTypes(executingAssembly).Length >= 140);
        }