Example #1
0
        public void TestGetDefaultConfigName()
        {
            const string text = @"
default:
sdk > client:
client *default:";

            Assert.AreEqual("client", YamlFromText.ConfigurationParser(text).GetDefaultConfigurationName());
        }
Example #2
0
        public void TestConfigNotExists()
        {
            const string text = @"
default:
sdk > client:
client *default:";

            Assert.IsFalse(YamlFromText.ConfigurationParser(text).ConfigurationExists("release"));
        }
Example #3
0
        public void TestConfigExists()
        {
            const string text = @"
default:
sdk > client:
client *default:";

            Assert.IsTrue(YamlFromText.ConfigurationParser(text).ConfigurationExists("sdk"));
        }
Example #4
0
        public void TestGetConfigurationsRealNames()
        {
            const string text = @"
default:
sdk > client:
client *default:";

            Assert.AreEqual(new[] { "sdk", "client" }.ToList(), YamlFromText.ConfigurationParser(text).GetConfigurations());
        }
Example #5
0
        public void TestGetParentConfigurationsIsNull()
        {
            const string text = @"
default:
full-build > sdk, client *default:
sdk > client:
client:";

            Assert.IsNull(YamlFromText.ConfigurationParser(text).GetParentConfigurations("client"));
        }
        public void TestGetParentConfigurations()
        {
            const string text = @"
default:
full-build > sdk, client *default:
sdk > client:
client:";

            Assert.AreEqual(new[] { "sdk", "client" }.ToList(),
                            YamlFromText.ConfigurationParser(text).GetParentConfigurations("full-build"));
        }
Example #7
0
        public void TestGetConfigurationHierarchy()
        {
            const string text      = @"
default:
full-build > sdk, client *default:
sdk > client:
client:
notests:";
            var          hierarchy = YamlFromText.ConfigurationParser(text).GetConfigurationsHierarchy();

            Assert.NotNull(hierarchy);
            Assert.AreEqual(2, hierarchy["client"].Count);
            Assert.AreEqual(0, hierarchy["full-build"].Count);
            Assert.AreEqual(1, hierarchy["sdk"].Count);
            Assert.AreEqual(0, hierarchy["notests"].Count);
        }