Пример #1
0
        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();
        }
Пример #2
0
        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();
        }
Пример #3
0
        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();
        }