示例#1
0
        public void VerifyNetReflectorTypeLoadExceptionMessage()
        {
            ReflectionTypeLoadException innerException = new ReflectionTypeLoadException(new Type[] { typeof(TestClass), null }, new Exception[] { new TypeLoadException("Failed to load TestSubClass") });
            Assembly assembly = Assembly.GetCallingAssembly();
            NetReflectorTypeLoadException exception = new NetReflectorTypeLoadException(assembly, innerException);

            AssertContains(assembly.GetName().ToString(), exception.Message);
            AssertContains("Failed to load 1 of the 2 types defined in the assembly.", exception.Message);
            AssertContains("Failed to load TestSubClass", exception.Message);
        }
		public void VerifyNetReflectorTypeLoadExceptionMessage()
		{
			ReflectionTypeLoadException innerException = new ReflectionTypeLoadException(new Type[] {typeof (TestClass), null}, new Exception[] {new TypeLoadException("Failed to load TestSubClass")});
			Assembly assembly = Assembly.GetCallingAssembly();
			NetReflectorTypeLoadException exception = new NetReflectorTypeLoadException(assembly, innerException);
			AssertContains(assembly.GetName().ToString(), exception.Message);
			AssertContains("Failed to load 1 of the 2 types defined in the assembly.", exception.Message);
			AssertContains("Failed to load TestSubClass", exception.Message);
		}