Antlr4.Test.StringTemplate.TestTemplateRawGroupDirectory.TestRawArgumentPassing C# (CSharp) Method

TestRawArgumentPassing() private method

private TestRawArgumentPassing ( ) : void
return void
        public void TestRawArgumentPassing()
        {
            string dir1 = tmpdir;
            string mainRawTemplate = "Hello $name$" + newline +
                "Then do the footer:" + newline +
                "$footerRaw(lastLine=veryLastLineRaw())$" + newline;
            string footerRawTemplate =
                "Simple footer. And now a last line:" + newline +
                "$lastLine$";
            string veryLastLineTemplate =
                "That's the last line.";
            writeFile(dir1, "mainRaw.st", mainRawTemplate);
            writeFile(dir1, "footerRaw.st", footerRawTemplate);
            writeFile(dir1, "veryLastLineRaw.st", veryLastLineTemplate);

            TemplateGroup group = new TemplateRawGroupDirectory(dir1, '$', '$');
            Template st = group.GetInstanceOf("mainRaw");
            Assert.IsNotNull(st);
            st.Add("name", "John");
            string result = st.Render();
            string expected =
                "Hello John" + newline +
                "Then do the footer:" + newline +
                "Simple footer. And now a last line:" + newline +
                "That's the last line." + newline;
            Assert.AreEqual(expected, result);
        }