public void MonoCannotResolveLegacyNetFrameworks(string shortFrameworkName)
        {
            var resolver = new FrameworkReferenceResolver();

            string path;
            Version version;
            Assert.False(resolver.TryGetAssembly("mscorlib", VersionUtility.ParseFrameworkName(shortFrameworkName), out path, out version));
        }
        public void MonoCannotResolveLegacyNetFrameworks(string shortFrameworkName)
        {
            var resolver = new FrameworkReferenceResolver();

            string  path;
            Version version;

            Assert.False(resolver.TryGetAssembly("mscorlib", VersionUtility.ParseFrameworkName(shortFrameworkName), out path, out version));
        }
        // Microsoft.Build.Engine (in 2.0, but overridden in 3.5)
        //[InlineData("net20", "Microsoft.Build.Engine", @"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Engine.dll", "2.0.0.0")]
        //[InlineData("net30", "Microsoft.Build.Engine", @"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Engine.dll", "2.0.0.0")]
        //[InlineData("net35", "Microsoft.Build.Engine", @"REFASMSROOT\v3.5\Microsoft.Build.Engine.dll", "3.5.0.0")]

        public void FrameworkResolverResolvesCorrectPaths(string shortFrameworkName, string assemblyName, string expectedPath, string expectedVersion)
        {
            var resolver = new FrameworkReferenceResolver();

            string actualPath;
            Version actualVersion;
            Assert.True(resolver.TryGetAssembly(assemblyName, VersionUtility.ParseFrameworkName(shortFrameworkName), out actualPath, out actualVersion));
            Assert.Equal(Environment.ExpandEnvironmentVariables(expectedPath).Replace("REFASMSROOT", FrameworkReferenceResolver.GetReferenceAssembliesPath()), actualPath);

            // Having this be Version->Version equality caused some problems...
            Assert.Equal(Version.Parse(expectedVersion).ToString(), actualVersion.ToString());
        }
Exemple #4
0
        // Microsoft.Build.Engine (in 2.0, but overridden in 3.5)
        //[InlineData("net20", "Microsoft.Build.Engine", @"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Engine.dll", "2.0.0.0")]
        //[InlineData("net30", "Microsoft.Build.Engine", @"%WINDIR%\Microsoft.NET\Framework\v2.0.50727\Microsoft.Build.Engine.dll", "2.0.0.0")]
        //[InlineData("net35", "Microsoft.Build.Engine", @"REFASMSROOT\v3.5\Microsoft.Build.Engine.dll", "3.5.0.0")]

        public void FrameworkResolverResolvesCorrectPaths(string shortFrameworkName, string assemblyName, string expectedPath, string expectedVersion)
        {
            var resolver = new FrameworkReferenceResolver();

            string  actualPath;
            Version actualVersion;

            Assert.True(resolver.TryGetAssembly(assemblyName, VersionUtility.ParseFrameworkName(shortFrameworkName), out actualPath, out actualVersion));
            Assert.Equal(Environment.ExpandEnvironmentVariables(expectedPath).Replace("REFASMSROOT", FrameworkReferenceResolver.GetReferenceAssembliesPath()), actualPath);

            // Having this be Version->Version equality caused some problems...
            Assert.Equal(Version.Parse(expectedVersion).ToString(), actualVersion.ToString());
        }