public void TestAddArray()
 {
     var test = new Header.HeaderSettingsNode();
     test.AddArray(new List<string>{"foo", "bar"}, new string[]{"raz", "blam"});
     var result = test.GetArray("foo", "bar");
     Assert.AreEqual(result.ToList()[0], "raz");
     Assert.AreEqual(result.ToList()[1], "blam");
 }
        public void TestIsEmpty()
        {
            var test = new Header.HeaderSettingsNode();
            Assert.IsTrue(test.IsEmpty());

            test = new Header.HeaderSettingsNode();
            test.AddSetting(new List<string>{"foo"}, "bar");
            Assert.IsFalse(test.IsEmpty());

            test = new Header.HeaderSettingsNode();
            test.AddArray(new List<string> { "raz" }, new List<string>{"blam"});
            Assert.IsFalse(test.IsEmpty());
        }
        public void TestToJSON()
        {
            var test = new Header.HeaderSettingsNode();
            test.AddSetting(new List<string>() { "foo", "bar", "raz" }, "foobar");

            var result = test.ToJson();
            Assert.AreEqual("{\"foo\" : {\"bar\" : {\"raz\" : \"foobar\"}}}", result);

            test = new Header.HeaderSettingsNode();
            test.AddSetting(new List<string>() { "foo", "bar", "raz" }, "foobar");
            test.AddSetting(new List<string>() { "barfoo", "barbar", "barraz" }, "barfoobar");

            result = test.ToJson();
            Assert.AreEqual("{\"foo\" : {\"bar\" : {\"raz\" : \"foobar\"}},\"barfoo\" : {\"barbar\" : {\"barraz\" : \"barfoobar\"}}}", result);

            test = new Header.HeaderSettingsNode();
            test.AddArray(new List<string>{"foo"}, new List<string>{"bar", "raz"});
            result = test.ToJson();
            Assert.AreEqual("{\"foo\" : [\"bar\", \"raz\"]}", result);
        }