Add tests for ResourceManager on custom Assembly type. (dotnet/corefx#34617)
authorFilip Navara <filip.navara@gmail.com>
Tue, 12 Feb 2019 08:52:56 +0000 (09:52 +0100)
committerStephen Toub <stoub@microsoft.com>
Tue, 12 Feb 2019 08:52:56 +0000 (03:52 -0500)
Commit migrated from https://github.com/dotnet/corefx/commit/24450dad74b0df3fc81026d7726b8441c41ae429

src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs

index b057bbf5c0631fed663a170118c53e80bb7a8dc5..69f5a2c4fce0b800a6b6976759e21edf08512661 100644 (file)
@@ -363,5 +363,18 @@ namespace System.Resources.Tests
                 }
             }
         }
+
+        [Fact]
+        [SkipOnTargetFramework(TargetFrameworkMonikers.UapAot, "UwpAot currently allows custom assembly in ResourceManager constructor")]
+        public static void ConstructorNonRuntimeAssembly()
+        {
+            MockAssembly assembly = new MockAssembly();
+            Assert.Throws<ArgumentException>(() => new ResourceManager("name", assembly));
+            Assert.Throws<ArgumentException>(() => new ResourceManager("name", assembly, null));
+        }
+
+        private class MockAssembly : Assembly
+        {
+        }
     }
 }