Ejemplo n.º 1
0
        public void TestComparerOperator()
        {
            var smallerDate = new DateTime(1000, 1, 1);
            var largerDate  = new DateTime(1999, 9, 9);

            Assert.IsTrue(this.Evaluate(ComparisonOperator.Greater <DateTime>(), largerDate, smallerDate));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Greater <DateTime>(), smallerDate, largerDate));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Greater <DateTime>(), smallerDate, largerDate));

            Assert.IsTrue(this.Evaluate(ComparisonOperator.GreaterOrEqual <int>(), 2, 1));
            Assert.IsTrue(this.Evaluate(ComparisonOperator.GreaterOrEqual <int>(), 2, 2));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.GreaterOrEqual <int>(), 1, 2));


            Assert.IsTrue(this.Evaluate(ComparisonOperator.Equal <int>(), 2, 2));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Equal <int>(), 1, 2));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Equal <int>(), 2, 1));

            Assert.IsTrue(this.Evaluate(ComparisonOperator.Smaller <int>(), 1, 2));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Smaller <int>(), 2, 1));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.Smaller <int>(), 2, 2));

            Assert.IsTrue(this.Evaluate(ComparisonOperator.SmallerOrEqual <int>(), 1, 2));
            Assert.IsTrue(this.Evaluate(ComparisonOperator.SmallerOrEqual <int>(), 2, 2));
            Assert.IsFalse(this.Evaluate(ComparisonOperator.SmallerOrEqual <int>(), 2, 1));
        }