Пример #1
0
        public void CalculateTest2()
        {
            var func = new DelegateExpression(p => 10.0);

            var result = func.Calculate(null);

            Assert.AreEqual(10.0, result);
        }
Пример #2
0
        public void CalculateTest1()
        {
            var parameters = new ParameterCollection()
            {
                new Parameter("x", 10)
            };
            var func = new DelegateExpression(p => (double)p.Parameters["x"] + 1);

            var result = func.Calculate(parameters);

            Assert.AreEqual(11.0, result);
        }