예제 #1
0
        public void GetPrefillReturnsEmptyStringIfVarNotFound()
        {
            var parser = new ReportTemplateParser(new StringReader("__var__X__var2:tst__"));

            Assert.AreEqual("", parser.GetPrefill("var"));
            Assert.AreEqual("tst", parser.GetPrefill("var2"));
        }
예제 #2
0
        public void ReportTemplateParserCorrectlyExtractsPrefilledInputAndReplacesIt()
        {
            var parser  = new ReportTemplateParser(new StringReader("Hello__ThisIsALongVariable__ __name:This is prefill__"));
            var prefill = parser.GetPrefill("name");

            Assert.AreEqual("This is prefill", prefill);
            parser.SetValue("ThisIsALongVariable", "asdf");
            parser.SetValue("name", prefill + ".");
            Assert.AreEqual("Helloasdf This is prefill.", parser.Parse());
        }