Beispiel #1
0
        public void ExecutePositiveTest_EqualityConstantStatement()
        {
            var output         = new StringBuilder();
            var templateReader = new StringReader("@if (true == true) { ! }");

            var ifStatement = new SingleLineIfStatement();

            (output, _) = ifStatement.Execute(templateReader, output);

            Assert.AreEqual("!", output.ToString().Trim());
        }
Beispiel #2
0
        public void ExecutePositiveTest_VariableBindStatement()
        {
            var output         = new StringBuilder();
            var templateReader = new StringReader("@if (variable) { ! }");

            var ifStatement = new SingleLineIfStatement();

            (output, _) = ifStatement.Execute(templateReader, output, new Dictionary <string, object>()
            {
                { "variable", true }
            });

            Assert.AreEqual("!", output.ToString().Trim());
        }