Пример #1
0
        public void CanApplyNotEqualsOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != 10).Expression is NotEqualsExpression);
            Assert.IsTrue((10m != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != 10m).Expression is NotEqualsExpression);
            Assert.IsTrue((10f != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != 10f).Expression is NotEqualsExpression);
            Assert.IsTrue((10d != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != 10d).Expression is NotEqualsExpression);
            Assert.IsTrue(("10" != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != "10").Expression is NotEqualsExpression);
            Assert.IsTrue((true != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != true).Expression is NotEqualsExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) != var).Expression is NotEqualsExpression);
            Assert.IsTrue((var != new DateTime(2010, 10, 10)).Expression is NotEqualsExpression);
        }
Пример #2
0
        public void CanApplyEqualsOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 == var).Expression is EqualsExpression);
            Assert.IsTrue((var == 10).Expression is EqualsExpression);
            Assert.IsTrue((10m == var).Expression is EqualsExpression);
            Assert.IsTrue((var == 10m).Expression is EqualsExpression);
            Assert.IsTrue((10f == var).Expression is EqualsExpression);
            Assert.IsTrue((var == 10f).Expression is EqualsExpression);
            Assert.IsTrue((10d == var).Expression is EqualsExpression);
            Assert.IsTrue((var == 10d).Expression is EqualsExpression);
            Assert.IsTrue(("10" == var).Expression is EqualsExpression);
            Assert.IsTrue((var == "10").Expression is EqualsExpression);
            Assert.IsTrue((true == var).Expression is EqualsExpression);
            Assert.IsTrue((var == true).Expression is EqualsExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) == var).Expression is EqualsExpression);
            Assert.IsTrue((var == new DateTime(2010, 10, 10)).Expression is EqualsExpression);
        }
Пример #3
0
        public void CanApplyGreaterThanOrEqualOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= 10).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((10m >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= 10m).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((10f >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= 10f).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((10d >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= 10d).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue(("10" >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= "10").Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((true >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= true).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) >= var).Expression is GreaterThanOrEqualToExpression);
            Assert.IsTrue((var >= new DateTime(2010, 10, 10)).Expression is GreaterThanOrEqualToExpression);
        }
Пример #4
0
        public void CanApplyGreaterThanOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > 10).Expression is GreaterThanExpression);
            Assert.IsTrue((10m > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > 10m).Expression is GreaterThanExpression);
            Assert.IsTrue((10f > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > 10f).Expression is GreaterThanExpression);
            Assert.IsTrue((10d > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > 10d).Expression is GreaterThanExpression);
            Assert.IsTrue(("10" > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > "10").Expression is GreaterThanExpression);
            Assert.IsTrue((true > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > true).Expression is GreaterThanExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) > var).Expression is GreaterThanExpression);
            Assert.IsTrue((var > new DateTime(2010, 10, 10)).Expression is GreaterThanExpression);
        }
Пример #5
0
        public void CanApplyLessThanOrEqualOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= 10).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((10m <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= 10m).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((10f <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= 10f).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((10d <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= 10d).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue(("10" <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= "10").Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((true <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= true).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) <= var).Expression is LessThanOrEqualToExpression);
            Assert.IsTrue((var <= new DateTime(2010, 10, 10)).Expression is LessThanOrEqualToExpression);
        }
Пример #6
0
        public void CanApplyLessThanOperatorBetweenSimpleValuesAndVariables()
        {
            // given
            VariableExpression var = new VariableExpression("var");

            // then
            Assert.IsTrue((10 < var).Expression is LessThanExpression);
            Assert.IsTrue((var < 10).Expression is LessThanExpression);
            Assert.IsTrue((10m < var).Expression is LessThanExpression);
            Assert.IsTrue((var < 10m).Expression is LessThanExpression);
            Assert.IsTrue((10f < var).Expression is LessThanExpression);
            Assert.IsTrue((var < 10f).Expression is LessThanExpression);
            Assert.IsTrue((10d < var).Expression is LessThanExpression);
            Assert.IsTrue((var < 10d).Expression is LessThanExpression);
            Assert.IsTrue(("10" < var).Expression is LessThanExpression);
            Assert.IsTrue((var < "10").Expression is LessThanExpression);
            Assert.IsTrue((true < var).Expression is LessThanExpression);
            Assert.IsTrue((var < true).Expression is LessThanExpression);
            Assert.IsTrue((new DateTime(2010, 10, 10) < var).Expression is LessThanExpression);
            Assert.IsTrue((var < new DateTime(2010, 10, 10)).Expression is LessThanExpression);
        }