示例#1
0
        public void TestSpaceVariableSubstitution()
        {
            var variable = new SpaceVariable();
            var template = variable.ToString(null);

            var engine = new TemplateEngine(template);

            engine.AddVariable(variable);

            var str = engine.ToString();

            Console.WriteLine(string.Format("SUBSTITUTED STRING: '{0}'", str));

            Assert.AreEqual(" ", str);
        }
示例#2
0
        public void TestSpaceVariableWithArgSubstitution()
        {
            var variable = new SpaceVariable();
            int count    = 3;
            var template = variable.ToString(count.ToString());

            var engine = new TemplateEngine(template);

            engine.AddVariable(variable);

            var str = engine.ToString();

            Console.WriteLine(string.Format("SUBSTITUTED STRING: '{0}'", str));

            Assert.AreEqual(new string(' ', count), str);
        }