Exemple #1
0
        public void TestCaseEvaluation4()
        {
            var directive = new ForEachDirective("BOO ? OF $", "BEER", TypeConverter);

            Assert.AreEqual(string.Empty, Evaluate("{BOO I OF \"\"}{I}{BEER}", directive));
        }
Exemple #2
0
        public void TestCaseEvaluation3()
        {
            var directive = new ForEachDirective("BOO ? OF $", "BEER", TypeConverter);

            Assert.AreEqual("123456789", Evaluate("{BOO I OF \"123456789\"}{I}{BEER}", directive));
        }
Exemple #3
0
        public void TestCaseEvaluation2()
        {
            var directive = new ForEachDirective("BOO ? OF $", "BEER", TypeConverter);

            Assert.AreEqual(string.Empty, Evaluate("{BOO I OF undefined}{I}{BEER}", directive, new KeyValuePair <string, object>("undefined", null)));
        }
Exemple #4
0
        public void TestCaseConstructor3()
        {
            var directive = new ForEachDirective("OVER $ GET EACH ?", "TERMINATE", TypeConverter);

            Assert.AreEqual("{OVER $ GET EACH ?}...{TERMINATE}", directive.ToString());
        }
Exemple #5
0
        public void TestCaseConstructor2()
        {
            var directive = new ForEachDirective(TypeConverter);

            Assert.AreEqual("{FOR EACH ? IN $}...{END}", directive.ToString());
        }
Exemple #6
0
        public void TestCaseEvaluation5()
        {
            var directive = new ForEachDirective("BOO ? OF $", "BEER", TypeConverter);

            Assert.AreEqual("102030", Evaluate("{BOO I OF list}{I}{BEER}", directive, new KeyValuePair <string, object>("list", new[] { 10, 20, 30 })));
        }