コード例 #1
0
        public void TestGetArtifactsNesting()
        {
            var text   = @"
client:
    install:
        - A
	artifacts:
		- A1
		- A2
full-build > client:
    install:
        - B
	artifacts:
		- B1
";
            var result = YamlFromText.InstallParser(text).Get();
            var builds = result.BuildFiles;

            Assert.AreEqual(2, builds.Count);
            Assert.AreEqual("B", builds[0]);
            Assert.AreEqual("A", builds[1]);

            var arifacts = result.Artifacts;

            CollectionAssert.AreEquivalent(new[] { "A1", "A2", "B1", "A", "B" }, arifacts);
        }
コード例 #2
0
        public void TestGetNuGet(string moduleYamlText, string[] expected)
        {
            var parser = YamlFromText.InstallParser(moduleYamlText);
            var parsed = parser.Get();

            var actual = parsed.NuGetPackages;

            actual.Should().BeEquivalentTo(expected, options => options.WithStrictOrdering());
        }
        public void TestGetMainConfigBuildFiles(string moduleYamlText, string[] expected)
        {
            var parser = YamlFromText.InstallParser(moduleYamlText);
            var parsed = parser.Get();

            var actual = parsed.CurrentConfigurationInstallFiles;

            actual.Should().BeEquivalentTo(expected, options => options.WithStrictOrdering());
        }
コード例 #4
0
        public void TestEmptySpec()
        {
            var text   = @"
default:
full-build:
";
            var result = YamlFromText.InstallParser(text).Get();

            Assert.AreEqual(new List <string>(), result.BuildFiles);
        }
コード例 #5
0
        public void TestGetInstallWithoutDefault()
        {
            var text   = @"
full-build:
    install:
        - A
";
            var result = YamlFromText.InstallParser(text).Get().BuildFiles;

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("A", result[0]);
        }
コード例 #6
0
        public void TestGetInstallFromDefault()
        {
            var text   = @"
default:
    install:
        - A
full-build:
";
            var result = YamlFromText.InstallParser(text).Get();

            Assert.AreEqual(1, result.BuildFiles.Count);
            Assert.AreEqual("A", result.BuildFiles[0]);
        }
コード例 #7
0
        public void TestGetArtifactsFromDefault()
        {
            var text   = @"
default:
	artifacts:
		- A
full-build:
";
            var result = YamlFromText.InstallParser(text).Get();

            Assert.AreEqual(1, result.Artifacts.Count);
            Assert.AreEqual("A", result.Artifacts[0]);
        }
コード例 #8
0
        public void TestGetExternalInstalls()
        {
            var text   = @"
full-build:
    deps:
        - ext
    install:
        - current
        - module ext";
            var result = YamlFromText.InstallParser(text).Get().ExternalModules;

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("ext", result[0]);
        }
コード例 #9
0
        public void TestGetNuGetInstalls()
        {
            var text   = @"
full-build:
    deps:
        - ext
    install:
        - current
        - nuget Newtonsoft.Json";
            var result = YamlFromText.InstallParser(text).Get().NuGetPackages;

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual("Newtonsoft.Json", result[0]);
        }
コード例 #10
0
        public void TestGetArtifactsWithAlias()
        {
            var text   = @"
full-build:
	artifacts:
		- A
    artefacts:
        - B
";
            var result = YamlFromText.InstallParser(text).Get();

            Assert.AreEqual(2, result.Artifacts.Count);
            Assert.AreEqual("A", result.Artifacts[0]);
            Assert.AreEqual("B", result.Artifacts[1]);
        }
コード例 #11
0
        public void TestGetInstallNesting()
        {
            var text   = @"
client:
    install:
        - A
full-build > client:
    install:
        - B
";
            var result = YamlFromText.InstallParser(text).Get().BuildFiles;

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual("B", result[0]);
            Assert.AreEqual("A", result[1]);
        }
コード例 #12
0
        public void TestGetInstallFromDefaultAndConfig()
        {
            var text   = @"
default:
    install:
        - A
full-build:
    install:
        - B
";
            var result = YamlFromText.InstallParser(text).Get().BuildFiles;

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual("B", result[0]);
            Assert.AreEqual("A", result[1]);
        }
コード例 #13
0
        public void TestLongNesting()
        {
            var text   = @"
default:
client:
    install:
        - B
sdk > client:
    install:
        - C
full-build > sdk:
    install:
        - D
";
            var result = YamlFromText.InstallParser(text).Get().BuildFiles.ToArray();

            Assert.AreEqual(new[] { "D", "C", "B" }, result);
        }