Ejemplo n.º 1
0
        public void ThrowOnInvalidBuildSection(string input, Type expectedException)
        {
            var parser        = new BuildSectionParser();
            var buildSections = GetBuildSections(input);

            Assert.Throws(expectedException, () => parser.ParseConfiguration(buildSections));
        }
Ejemplo n.º 2
0
        public void ParseBuildConfigurationSections(string input, BuildData defaults, BuildData[] expected)
        {
            var parser        = new BuildSectionParser();
            var buildSections = GetBuildSections(input);
            var actual        = parser.ParseConfiguration(buildSections, defaults);

            actual.Should().BeEquivalentTo(expected);
        }
Ejemplo n.º 3
0
        public string DefineCorrectDefaultToolVersion(string toolName, string settingVersion, string defaultVersion)
        {
            var settings = new CementSettings {
                DefaultMsBuildVersion = settingVersion
            };
            var input    = $@"build:
  target: Solution.sln
  configuration: Release
  tool:
    name: {toolName}
";
            var defaults = new BuildData(null, null, new Tool(null, defaultVersion), new List <string>(), string.Empty);

            var parser        = new BuildSectionParser(settings);
            var buildSections = GetBuildSections(input);
            var actual        = parser.ParseConfiguration(buildSections, defaults);

            return(actual?[0].Tool.Version);
        }