Example #1
0
        public void SimpleExpressionEvaluateNonBoolean()
        {
            EventPerson person1 = new EventPerson()
            {
                Name            = "Mathias",
                ColorComplexion = 5,
                Height          = 10,
                Event           = "Wedding"
            };
            Evaluator evaluator = new Evaluator();
            var       result    = evaluator.EvaluateNonBoolean <EventPerson, double>(
                " 21 * (64 / 4 + (13 * 2)) ", person1); //,'Beautiful Dress'

            Assert.AreEqual(result, 882);
        }
Example #2
0
        public void SimpleExpressionPreEvaluatorEventPersonWithThenMethod()
        {
            EventPerson person1 = new EventPerson()
            {
                Name            = "Mathias",
                ColorComplexion = 5,
                Height          = 10,
                Event           = "Wedding"
            };
            Evaluator evaluator = new Evaluator();
            bool      result    = evaluator.Evaluate <EventPerson>(
                " (ColorComplexion > 4 && Height > 5 && Event = 'Test') then SetDressNumber(5, 'Beautiful Dress') else SetDressNumber(10, 'Other Dress') ", person1); //,'Beautiful Dress'

            Assert.AreEqual(person1.DressNumber, 10);
            Assert.AreEqual(person1.DressName, "Other Dress");
        }