Example #1
0
        public void TestUnsupportedValue()
        {
            var unsupportedValue        = new { Name = "Shaun", Age = 99 };
            var constantValueExpression = new ConstantValueExpression(unsupportedValue);

            Assert.AreEqual(unsupportedValue, constantValueExpression.Evaluate(null));
        }
Example #2
0
        public void TestDateTimeValue()
        {
            var now = DateTime.Now;

            var constantValueExpression = new ConstantValueExpression(now);

            Assert.AreEqual(now, constantValueExpression.Evaluate(null));
        }
Example #3
0
        public void TestStringValue()
        {
            var constantValueExpression = new ConstantValueExpression("123");

            Assert.AreEqual("123", constantValueExpression.Evaluate(null));
        }
Example #4
0
        public void TestLongValue()
        {
            var constantValueExpression = new ConstantValueExpression(123L);

            Assert.AreEqual(123L, constantValueExpression.Evaluate(null));
        }
Example #5
0
        public void TestIntegerValue()
        {
            var constantValueExpression = new ConstantValueExpression(123);

            Assert.AreEqual(123, constantValueExpression.Evaluate(null));
        }
Example #6
0
        public void TestDoubleValue()
        {
            var constantValueExpression = new ConstantValueExpression(123d);

            Assert.AreEqual(123d, constantValueExpression.Evaluate(null));
        }
Example #7
0
        public void TestDecimalValue()
        {
            var constantValueExpression = new ConstantValueExpression(123M);

            Assert.AreEqual(123M, constantValueExpression.Evaluate(null));
        }
Example #8
0
        public void TestBooleanValue()
        {
            var constantValueExpression = new ConstantValueExpression(true);

            Assert.AreEqual(true, constantValueExpression.Evaluate(null));
        }