public void TestXml() {
            var xml = @"
<xml>
    <parameters>
        <add name='p1' value='true' />
        <add name='p2' value='false' />
    </parameters>
</xml>".Replace("'", "\"");

            var cfg = new TestDifferentXmlParser(xml, new XDocumentParser());

            foreach (var problem in cfg.Errors()) {
                Console.WriteLine(problem);
            }

            var problems = cfg.Errors();
            Assert.AreEqual(0, problems.Length);

            Assert.AreEqual(true, cfg.Parameters.First().Value);
            Assert.AreEqual(false, cfg.Parameters.Last().Value);

        }
Example #2
0
        public void TestXml()
        {
            var xml = @"
<xml>
    <parameters>
        <add name='p1' value='true' />
        <add name='p2' value='false' />
    </parameters>
</xml>".Replace("'", "\"");

            var cfg = new TestDifferentXmlParser(xml, new XDocumentParser());

            foreach (var problem in cfg.Errors())
            {
                Console.WriteLine(problem);
            }

            var problems = cfg.Errors();

            Assert.AreEqual(0, problems.Length);

            Assert.AreEqual(true, cfg.Parameters.First().Value);
            Assert.AreEqual(false, cfg.Parameters.Last().Value);
        }