public async Task ReturnsNullWhenVersionNotFound() { var loader = new FileAssemblyLoader(NullLogger <FileAssemblyLoader> .Instance, ImmutableArray.Create("Data")); var assemblyLoadContext = new AssemblyLoadContext(null, true); var assembly = await loader.TryLoadAssemblyAsync( assemblyLoadContext, new Dependency("FluentLang.Runtime", "1.2.3.4")); Assert.Null(assembly); assemblyLoadContext.Unload(); }
public async Task IfNotFoundInFirstPathLooksInSecond() { var loader = new FileAssemblyLoader(NullLogger <FileAssemblyLoader> .Instance, ImmutableArray.Create("notADirectory", "Data")); var assemblyLoadContext = new AssemblyLoadContext(null, true); var assembly = await loader.TryLoadAssemblyAsync( assemblyLoadContext, new Dependency("FluentLang.Runtime", "1.0.0.0")); Assert.NotNull(assembly?.Assembly.GetType(typeof(FLObject).FullName !)); assemblyLoadContext.Unload(); }
public async Task CanLoadAssemblyFromFile() { var loader = new FileAssemblyLoader(NullLogger <FileAssemblyLoader> .Instance, ImmutableArray.Create("Data")); var assemblyLoadContext = new AssemblyLoadContext(null, true); var assembly = await loader.TryLoadAssemblyAsync( assemblyLoadContext, new Dependency("FluentLang.Runtime", "1.0.0.0")); Assert.NotNull(assembly?.Assembly.GetType(typeof(FLObject).FullName !)); assemblyLoadContext.Unload(); }