Exemplo n.º 1
0
        public void TimeTriggerExprParse_WithoutRepeat()
        {
            var result = DslParser.TimeTriggerExprParse().Parse("trigger 2015-08-09 01:02:03");

            result.Start.Year.Should().Be(2015);
            result.Start.Month.Should().Be(8);
            result.Start.Day.Should().Be(9);

            result.Start.Hour.Should().Be(1);
            result.Start.Minute.Should().Be(2);
            result.Start.Second.Should().Be(3);

            result.Repeat.HasValue.Should().BeFalse();
        }
Exemplo n.º 2
0
        public void TimeTriggerExprParse()
        {
            var result = DslParser.TimeTriggerExprParse().Parse("trigger 2015-08-09 01:02:03 repeat 4d5h6m7s");

            result.Start.Year.Should().Be(2015);
            result.Start.Month.Should().Be(8);
            result.Start.Day.Should().Be(9);

            result.Start.Hour.Should().Be(1);
            result.Start.Minute.Should().Be(2);
            result.Start.Second.Should().Be(3);

            result.Repeat.HasValue.Should().BeTrue();
            result.Repeat?.Days.Should().Be(4);
            result.Repeat?.Hours.Should().Be(5);
            result.Repeat?.Minutes.Should().Be(6);
            result.Repeat?.Seconds.Should().Be(7);
        }