Exemple #1
0
        public void ThrowOnInvalidBuildSection(string input, Type expectedException)
        {
            var parser        = new BuildSectionParser();
            var buildSections = GetBuildSections(input);

            Assert.Throws(expectedException, () => parser.ParseConfiguration(buildSections));
        }
Exemple #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);
        }
Exemple #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);
        }