Esempio n. 1
0
        public void ParseIndentTest1()
        {
            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("               ");
            writer.Flush();
            stream.Seek(0, SeekOrigin.Begin);

            using (TextReader reader = new StreamReader(stream))
            {
                YamlParser parser = new YamlParser(reader, null);
                Assert.AreEqual(15, parser.ParseIndent(), "ParseIndentTest1#100");
                Assert.AreEqual(15, parser.ParseIndent(), "ParseIndentTest1#200");
            }
        }
Esempio n. 2
0
        public void ParseIndentTest3()
        {
            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);

            writer.WriteLine("               ");
            writer.Flush();
            stream.Seek(0, SeekOrigin.Begin);

            using (TextReader reader = new StreamReader(stream))
            {
                YamlParser parser = new YamlParser(reader, null);
                Assert.IsFalse(parser.ParseIndent(5), "ParseIndentTest3#100");
                Assert.IsFalse(parser.ParseIndent(10), "ParseIndentTest3#200");
                Assert.IsTrue(parser.ParseIndent(15), "ParseIndentTest3#300");
            }
        }