Пример #1
0
        public void GetValue_IllegalNodePath()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValue("");

            Assert.IsNull(actual);
        }
Пример #2
0
        public void GetValue_Child()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValue("Par.Chi");

            Assert.AreEqual("ChildValue", actual);
        }
Пример #3
0
        public void GetValue_AdditionalFilter()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValue("Par.Bro", e => e.Value.StartsWith("a"));

            Assert.True(actual.StartsWith("a"));
        }
Пример #4
0
        public void GetElements()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetElements("At");

            Assert.IsTrue(actual.Count() > 0);
        }
Пример #5
0
        public void GetValue()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValue("hoge");

            Assert.AreEqual("XXX", actual);
        }
Пример #6
0
        public void GetValues_IllegalNodePath()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValues("");

            Assert.NotNull(actual);
            Assert.AreEqual(0, actual.Count());
        }
Пример #7
0
        public void GetValues_AdditionalFilter()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValues("Par.Sis", e => e.Value.StartsWith("x"));

            Assert.AreEqual(3, actual.Count());
            actual.ForEach(v => Assert.IsTrue(v.StartsWith("x")));
        }
Пример #8
0
        public void GetValues()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetValues("Mul");

            Assert.AreEqual(2, actual.Count());
            actual.ForEach(v => Assert.IsNotNull(v));
        }
Пример #9
0
        public void GetElements_AdditionalFilter()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetElements("At", el => el.GetAttrValue("hogeAttr") == "wao");

            Assert.IsTrue(actual.Count() > 0);
            actual.ForEach(el => Assert.AreEqual("wao", el.GetAttrValue("hogeAttr")));
        }
Пример #10
0
        public void GetElement_AdditionalFilter()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetElement("At", el => el.GetAttrValue("hogeAttr") == "wao");

            Assert.NotNull(actual);
            Assert.AreEqual("wao", actual.GetAttrValue("hogeAttr"));
        }
Пример #11
0
        public void GetElement()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");
            var          actual = target.GetElement("At");

            Assert.NotNull(actual);
            Assert.AreEqual(typeof(XElement), actual.GetType());
        }
Пример #12
0
        public void Load_Exists()
        {
            IQuillConfig target = QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest.xml");

            Assert.NotNull(target);
        }
Пример #13
0
 public void Load_NotFoundQuillSection()
 {
     TU.ExecuteExcectedException <QuillException>(
         () => QuillConfigImpl.Load("Config/Impl/Files/QuillConfigImplTest_NoQuillSection.xml"));
 }
Пример #14
0
 public void Load_NotExistsPath()
 {
     TU.ExecuteExcectedException <FileNotFoundException>(() => QuillConfigImpl.Load("NotExists"));
 }
Пример #15
0
 public void Load_NullPath()
 {
     TU.ExecuteExcectedException <ArgumentNullException>(() => QuillConfigImpl.Load(null));
 }