Exemplo n.º 1
0
        public void Build_WhenMultipleEqualsSignsInArgument_AllSignsAfterFirstIgnored()
        {
            string test = "connstring=server=localhost;user=sa;";
            var    sut  = new ArgumentManifestConfigurationProvider(new[] { test });

            Dictionary <string, string> actual = new Dictionary <string, string>();

            actual = sut.Build(actual);

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual("server=localhost;user=sa;", actual["connstring"]);
        }
Exemplo n.º 2
0
        public void Build_CreatesConfigurationEntries()
        {
            string test = "name=happypath";
            var    sut  = new ArgumentManifestConfigurationProvider(new[] { test });

            Dictionary <string, string> actual = new Dictionary <string, string>();

            actual = sut.Build(actual);

            Assert.AreEqual(1, actual.Count);
            Assert.AreEqual("happypath", actual["name"]);
        }
Exemplo n.º 3
0
        public void Build_WhenResultsStartsWithValues_ValuesArePersisted()
        {
            string test = "name=happypath";
            var    sut  = new ArgumentManifestConfigurationProvider(new[] { test });

            Dictionary <string, string> actual = new Dictionary <string, string>()
            {
                { "preexisting_key", "preexisting_value" }
            };

            actual = sut.Build(actual);

            Assert.AreEqual(2, actual.Count);
            Assert.AreEqual("happypath", actual["name"]);
            Assert.AreEqual("preexisting_value", actual["preexisting_key"]);
        }
Exemplo n.º 4
0
        public void Build_WhenMultipleArgumentsProvided_MultipleResultsAdded()
        {
            var sut = new ArgumentManifestConfigurationProvider(new[] {
                "name=happypath",
                "path=c:\\temppath",
                "description=The happy path"
            });

            Dictionary <string, string> actual = new Dictionary <string, string>();

            actual = sut.Build(actual);

            Assert.AreEqual(3, actual.Count);
            Assert.AreEqual("happypath", actual["name"]);
            Assert.AreEqual("c:\\temppath", actual["path"]);
            Assert.AreEqual("The happy path", actual["description"]);
        }