Наследование: MinuteTimeRange
Пример #1
0
        public void MinuteTest() {
            var now = ClockProxy.Clock.Now;
            var firstMinute = now.TrimToSecond();
            var secondMinute = firstMinute.AddMinutes(1);

            var m = new MinuteRange(now, TimeCalendar.NewEmptyOffset());

            m.Start.Should().Be(firstMinute);
            m.End.Should().Be(secondMinute);
        }
Пример #2
0
        public void MinuteTest()
        {
            var now          = ClockProxy.Clock.Now;
            var firstMinute  = now.TrimToSecond();
            var secondMinute = firstMinute.AddMinutes(1);

            var m = new MinuteRange(now, TimeCalendar.NewEmptyOffset());

            m.Start.Should().Be(firstMinute);
            m.End.Should().Be(secondMinute);
        }
Пример #3
0
        public void AddMinutes() {
            var now = ClockProxy.Clock.Now;

            var m = new MinuteRange(now, TimeCalendar.NewEmptyOffset());
            var minuteTime = now.TrimToSecond();

            m.AddMinutes(-1).Start.Should().Be(minuteTime.AddMinutes(-1));
            m.AddMinutes(1).Start.Should().Be(minuteTime.AddMinutes(1));

            Enumerable
                .Range(-TimeSpec.MinutesPerHour * 2, TimeSpec.MinutesPerHour * 2)
                .RunEach(i => m.AddMinutes(i).Start.Should().Be(minuteTime.AddMinutes(i)));
        }
Пример #4
0
        public void AddMinutes()
        {
            var now = ClockProxy.Clock.Now;

            var m          = new MinuteRange(now, TimeCalendar.NewEmptyOffset());
            var minuteTime = now.TrimToSecond();

            m.AddMinutes(-1).Start.Should().Be(minuteTime.AddMinutes(-1));
            m.AddMinutes(1).Start.Should().Be(minuteTime.AddMinutes(1));

            Enumerable
            .Range(-TimeSpec.MinutesPerHour * 2, TimeSpec.MinutesPerHour * 2)
            .RunEach(i => m.AddMinutes(i).Start.Should().Be(minuteTime.AddMinutes(i)));
        }
Пример #5
0
        public void DefaultCalendarTest() {
            var now = ClockProxy.Clock.Now;
            var currentHour = now.TrimToMinute();

            Enumerable
                .Range(0, TimeSpec.MinutesPerHour)
                .RunEach(m => {
                             var minute = new MinuteRange(currentHour.AddMinutes(m));

                             minute.Start.Should().Be(currentHour.AddMinutes(m).Add(minute.TimeCalendar.StartOffset));
                             minute.End.Should().Be(currentHour.AddMinutes(m + 1).Add(minute.TimeCalendar.EndOffset));

                             minute.UnmappedStart.Should().Be(currentHour.AddMinutes(m));
                             minute.UnmappedEnd.Should().Be(currentHour.AddMinutes(m + 1));
                         });
        }
Пример #6
0
        public void DefaultCalendarTest()
        {
            var now         = ClockProxy.Clock.Now;
            var currentHour = now.TrimToMinute();

            Enumerable
            .Range(0, TimeSpec.MinutesPerHour)
            .RunEach(m => {
                var minute = new MinuteRange(currentHour.AddMinutes(m));

                minute.Start.Should().Be(currentHour.AddMinutes(m).Add(minute.TimeCalendar.StartOffset));
                minute.End.Should().Be(currentHour.AddMinutes(m + 1).Add(minute.TimeCalendar.EndOffset));

                minute.UnmappedStart.Should().Be(currentHour.AddMinutes(m));
                minute.UnmappedEnd.Should().Be(currentHour.AddMinutes(m + 1));
            });
        }
Пример #7
0
        public void MextMinute()
        {
            var minute = new MinuteRange();

            minute.GetNextMinute().Should().Be(minute.AddMinutes(1));
        }
Пример #8
0
        public void PreviousMinute()
        {
            var minute = new MinuteRange();

            minute.GetPreviousMinute().Should().Be(minute.AddMinutes(-1));
        }
Пример #9
0
 public void MextMinute() {
     var minute = new MinuteRange();
     minute.GetNextMinute().Should().Be(minute.AddMinutes(1));
 }
Пример #10
0
 public void PreviousMinute() {
     var minute = new MinuteRange();
     minute.GetPreviousMinute().Should().Be(minute.AddMinutes(-1));
 }