コード例 #1
0
        public void TestEvaluateOnlyEnd3()
        {
            var end        = new DateTime(2018, 8, 1, 0, 0, 0);
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(end + TimeSpan.FromTicks(1)), new DateTimeInterval(null, end));

            expression.Evaluate(null).Should().BeFalse("because the specified timestamp is greater than end");
        }
コード例 #2
0
        public void TestEvaluateOnlyEnd1()
        {
            var end        = new DateTime(2018, 8, 1, 0, 0, 0);
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(end), new DateTimeInterval(null, end));

            expression.Evaluate(null).Should().BeTrue("because the specified timestamp is equal to end");
        }
コード例 #3
0
        public void TestEvaluateOnlyStart3()
        {
            var start      = new DateTime(2018, 8, 1, 0, 0, 0);
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(start + TimeSpan.FromTicks(1)), new DateTimeInterval(start, null));

            expression.Evaluate(null).Should().BeTrue("because the specified timestamp is greater than start");
        }
コード例 #4
0
        public void TestEvaluateOnlyStart1()
        {
            var start      = new DateTime(2018, 8, 1, 0, 0, 0);
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(start), new DateTimeInterval(start, null));

            expression.Evaluate(null).Should().BeTrue("because the specified timestamp is equal to start");
        }
コード例 #5
0
        public void TestEvaluateNullInterval()
        {
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(DateTime.Now),
                                                             new DateTimeInterval(null, null));

            expression.Evaluate(null).Should().BeFalse("because nothing can be part of a null interval");
        }
コード例 #6
0
        public void TestEvaluateNullTimestamp()
        {
            var expression = new ContainsTimestampExpression(new DateTimeLiteral(null),
                                                             new DateTimeIntervalLiteral(SpecialDateTimeInterval.Today));

            expression.Evaluate(null).Should().BeFalse("because a null timestamp is not part of any interval");
        }