public void Load_CanLoadAssemblyByName_AfterLoadingByPath() { // Arrange var directory = _testAssetsManager.CreateTestDirectory(); var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); var assembly1 = loader.LoadFromPath(alphaFilePath); // Act var assembly2 = loader.Load(assembly1.FullName); // Assert Assert.Same(assembly1, assembly2); }
public void LoadFromPath_DoesNotAddDuplicates_AfterLoadingByName() { // Arrange var directory = _testAssetsManager.CreateTestDirectory(); var alphaFilePath = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha.dll"); var alphaFilePath2 = LoaderTestResources.Alpha.WriteToFile(directory.Path, "Alpha2.dll"); var loader = new TestDefaultExtensionAssemblyLoader(Path.Combine(directory.Path, "shadow")); loader.AddAssemblyLocation(alphaFilePath); var assembly1 = loader.Load("Alpha"); // Act var assembly2 = loader.LoadFromPath(alphaFilePath2); // Assert Assert.Same(assembly1, assembly2); }