Exemplo n.º 1
0
        public void TestPredictSolutionConfigurationName()
        {
            string solutionFileContents =
                @"
                Microsoft Visual Studio Solution File, Format Version 9.00
                Global
                    GlobalSection(SolutionConfigurationPlatforms) = preSolution
                        Release|Mixed Platforms = Release|Mixed Platforms
                        Release|Win32 = Release|Win32
                        Debug|Mixed Platforms = Debug|Mixed Platforms
                        Debug|Win32 = Debug|Win32
                    EndGlobalSection
                EndGlobal
                ";

            SolutionParser solution = SolutionParser_Tests.ParseSolutionHelper(solutionFileContents);
            Engine         engine   = new Engine();

            Assertion.AssertEquals("Debug|Mixed Platforms", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine));

            engine.GlobalProperties.SetProperty("Configuration", "Release");
            Assertion.AssertEquals("Release|Mixed Platforms", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine));

            engine.GlobalProperties.SetProperty("Platform", "Win32");
            Assertion.AssertEquals("Release|Win32", SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine));

            engine.GlobalProperties.SetProperty("Configuration", "Nonexistent");
            Assertion.AssertEquals(null, SolutionWrapperProject.PredictActiveSolutionConfigurationName(solution, engine));
        }