public void GetAssemblyLocation_CodeBase_HasPoundCharacterDOSPath() { var destination = Path.Combine(AssemblyDirectory, "RelatedAssembly.dll"); var expected = @"C:\#NIN\dotnetcore\tryx\try1.dll"; var assembly = new TestAssembly { CodeBaseSettable = "file:///C:/#NIN/dotnetcore/tryx/try1.dll", LocationSettable = expected, }; // Act var actual = RelatedAssemblyAttribute.GetAssemblyLocation(assembly); Assert.Equal(expected, actual); }
public void GetAssemblyLocation_UsesCodeBase() { // Arrange var destination = Path.Combine(AssemblyDirectory, "RelatedAssembly.dll"); var codeBase = "file://x/file/Assembly.dll"; var expected = new Uri(codeBase).LocalPath; var assembly = new TestAssembly { CodeBaseSettable = codeBase, }; // Act var actual = RelatedAssemblyAttribute.GetAssemblyLocation(assembly); Assert.Equal(expected, actual); }
public void GetAssemblyLocation_UsesLocation_IfCodeBaseIsNotLocal() { // Arrange var destination = Path.Combine(AssemblyDirectory, "RelatedAssembly.dll"); var expected = Path.Combine(AssemblyDirectory, "Some-Dir", "Assembly.dll"); var assembly = new TestAssembly { CodeBaseSettable = "https://www.microsoft.com/test.dll", LocationSettable = expected, }; // Act var actual = RelatedAssemblyAttribute.GetAssemblyLocation(assembly); Assert.Equal(expected, actual); }