Beispiel #1
0
        public void EnsureEquivalentBuildSections(string path)
        {
            var text            = pathToContentMap[path];
            var parser          = ModuleYamlParserFactory.Get();
            var buildYamlParser = new BuildYamlParser("fake", text);

            var md      = parser.Parse(text);
            var configs = md.AllConfigurations.Keys.ToArray();

            foreach (var config in configs)
            {
                var newBuild = md[config].Builds;
                var oldBuild = buildYamlParser.Get(config);

                var oldBuildIsActuallyEmpty = oldBuild.Count == 1 &&
                                              oldBuild[0].Configuration == null &&
                                              oldBuild[0].Name == string.Empty &&
                                              oldBuild[0].Target == string.Empty &&
                                              oldBuild[0].Parameters.Count == 0;

                if (newBuild != null && !oldBuildIsActuallyEmpty)
                {
                    newBuild.Should().BeEquivalentTo(oldBuild);
                }
            }
        }
Beispiel #2
0
        public void OldYamlParsersDoNotThrow(string path)
        {
            var text = pathToContentMap[path];

            var depsSectionParser    = new DepsYamlParser("fake", text);
            var installSectionParser = new InstallYamlParser("fake", text);
            var buildSectionParser   = new BuildYamlParser("fake", text);

            var configs = depsSectionParser.GetConfigurations();

            foreach (var config in configs)
            {
                Assert.DoesNotThrow(() =>
                {
                    depsSectionParser.Get(config);
                    installSectionParser.Get(config);
                    buildSectionParser.Get(config);
                });
            }
        }