Esempio n. 1
0
        public void MSBuildToolsetsTest_Basic()
        {
            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                   <msbuildToolsets default=""2.0"">
                     <toolset toolsVersion=""2.0"">
                       <property name=""MSBuildBinPath"" value=""D:\windows\Microsoft.NET\Framework\v2.0.x86ret\""/>
                     </toolset>
                   </msbuildToolsets>
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();
            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;

            Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0");
            Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count);

            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement(0).toolsVersion, "2.0");
            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count, 1);
            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value,
                                   @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\");
        }
Esempio n. 2
0
        public void MSBuildToolsetsTest_EmptyElement()
        {
            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                   <msbuildToolsets />
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();
            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;

            Assertion.AssertNotNull(msbuildToolsetSection);
            Assertion.AssertEquals(null, msbuildToolsetSection.Default);
            Assertion.AssertNotNull(msbuildToolsetSection.Toolsets);
            Assertion.AssertEquals(0, msbuildToolsetSection.Toolsets.Count);
        }
Esempio n. 3
0
        public void PropertyTest_ValueNotSpecified()
        {
            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                   <msbuildToolsets default=""3.5"">
                     <toolset name=""3.5"">
                       <property name=""MSBuildBinPath"" />
                     </toolset>
                   </msbuildToolsets>
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();

            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;
        }
Esempio n. 4
0
        public void PropertyTest_NameNotSpecified()
        {
            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                   <msbuildToolsets default=""3.5"">
                     <toolset toolsVersion=""3.5"">
                       <property value=""D:\windows\Microsoft.NET\Framework\v3.5.x86ret\""/>
                     </toolset>
                   </msbuildToolsets>
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();

            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;
        }
Esempio n. 5
0
        public void ToolsVersionTest_MultipleElementsWithSameName()
        {
            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                   <msbuildToolsets default=""2.0"">
                     <toolset toolsVersion=""2.0"">
                       <property name=""MSBuildBinPath"" value=""D:\windows\Microsoft.NET\Framework\v2.0.x86ret\""/>
                     </toolset>
                     <toolset toolsVersion=""2.0"">
                       <property name=""MSBuildBinPath"" value=""D:\windows\Microsoft.NET\Framework\v3.5.x86ret\""/>
                     </toolset>
                   </msbuildToolsets>
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();

            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;
        }
Esempio n. 6
0
        public void MSBuildToolsetsTest_BasicWithOtherConfigEntries()
        {
            // NOTE: for some reason, <configSections> MUST be the first element under <configuration>
            // for the API to read it. The docs don't make this clear.

            ToolsetConfigurationReaderTestHelper.WriteConfigFile(@"
                 <configuration>
                   <configSections>
                     <section name=""msbuildToolsets"" type=""net.r_eg.IeXod.BuildEngine.ToolsetConfigurationSection, net.r_eg.IeXod.Engine"" />
                   </configSections>
                    <startup>
                     <supportedRuntime imageVersion=""v2.0.60510"" version=""v2.0.x86chk""/>
                     <requiredRuntime imageVersion=""v2.0.60510"" version=""v2.0.x86chk"" safemode=""true""/>
                   </startup>
                   <msbuildToolsets default=""2.0"">
                     <toolset toolsVersion=""2.0"">
                       <property name=""MSBuildBinPath"" value=""D:\windows\Microsoft.NET\Framework\v2.0.x86ret\""/>
                     </toolset>
                   </msbuildToolsets>
                   <runtime>
                     <assemblyBinding xmlns=""urn:schemas-microsoft-com:asm.v1"">
                       <dependentAssembly>
                          <assemblyIdentity name=""net.r_eg.IeXod.Framework"" publicKeyToken=""4bbd2ef743db151e"" culture=""neutral""/>
                          <bindingRedirect oldVersion=""0.0.0.0-99.9.9.9"" newVersion=""2.0.0.0""/>
                       </dependentAssembly>
                     </assemblyBinding>
                   </runtime>
                 </configuration>");

            Configuration config = ToolsetConfigurationReaderTestHelper.ReadApplicationConfigurationTest();
            ToolsetConfigurationSection msbuildToolsetSection = config.GetSection(msbuildToolsets) as ToolsetConfigurationSection;

            Assertion.AssertEquals(msbuildToolsetSection.Default, "2.0");
            Assertion.AssertEquals(1, msbuildToolsetSection.Toolsets.Count);

            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement(0).toolsVersion, "2.0");
            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.Count, 1);
            Assertion.AssertEquals(msbuildToolsetSection.Toolsets.GetElement("2.0").PropertyElements.GetElement("MSBuildBinPath").Value,
                                   @"D:\windows\Microsoft.NET\Framework\v2.0.x86ret\");
        }
Esempio n. 7
0
 public void Teardown()
 {
     ToolsetConfigurationReaderTestHelper.CleanUp();
 }