public void TryResolveAssembly_WithReferencedAssemblyName_ResolvesAssemblyPathAndReturnsTrue()
        {
            PackageAssemblyResolver assemblyResolver = CreateResolver();

            bool result = assemblyResolver.TryResolveAssembly(this.GetType().Assembly.FullName, out string assemblyPath);

            Assert.True(result);
            Assert.Equal(_targetAssemblyFilePath, assemblyPath);
        }
        public void TryResolveAssembly_WithReferencedFrameworkAssemblyName_ResolvesAssemblyAndReturnsTrue()
        {
            PackageAssemblyResolver assemblyResolver = CreateResolver();

            bool result = assemblyResolver.TryResolveAssembly("System.Net.Http", out string assemblyPath);

            Assert.True(result);
            Assert.Equal("System.Net.Http", assemblyPath);
        }
Example #3
0
        public void TryResolveAssembly_WithReferencedFrameworkAssemblyName_ResolvesAssemblyAndReturnsTrue()
        {
            var functionMetadata = new FunctionMetadata()
            {
                Name       = "TestFunction",
                ScriptFile = _lockFilePath, /*We just need the path from this*/
                ScriptType = ScriptType.CSharp
            };

            var assemblyResolver = new PackageAssemblyResolver(functionMetadata);

            string assemblyPath;
            bool   result = assemblyResolver.TryResolveAssembly("System.Net.Http", out assemblyPath);

            Assert.True(result);
            Assert.Equal("System.Net.Http", assemblyPath);
        }
Example #4
0
        public void TryResolveAssembly_WithReferencedAssemblyName_ResolvesAssemblyPathAndReturnsTrue()
        {
            var functionMetadata = new FunctionMetadata()
            {
                Name       = "TestFunction",
                ScriptFile = _lockFilePath, /*We just need the path from this*/
                ScriptType = ScriptType.CSharp
            };

            var assemblyResolver = new PackageAssemblyResolver(functionMetadata);

            string assemblyPath;
            bool   result = assemblyResolver.TryResolveAssembly(this.GetType().Assembly.FullName, out assemblyPath);

            Assert.True(result);
            Assert.Equal(_targetAssemblyFilePath, assemblyPath);
        }