Exemplo n.º 1
0
        public void EndTest()
        {
            DateTime        now         = ClockProxy.Clock.Now;
            TimePeriodChain timePeriods = new TimePeriodChain();

            Assert.Equal(timePeriods.End, TimeSpec.MaxPeriodDate);

            timePeriods.Add(new TimeBlock(Duration.Hour, now));
            Assert.Equal <DateTime>(timePeriods.End, now);

            timePeriods.Clear();
            Assert.Equal(timePeriods.End, TimeSpec.MaxPeriodDate);
        }         // EndTest
Exemplo n.º 2
0
        public void StartTest()
        {
            DateTime        now         = ClockProxy.Clock.Now;
            TimePeriodChain timePeriods = new TimePeriodChain();

            Assert.Equal(timePeriods.Start, TimeSpec.MinPeriodDate);

            timePeriods.Add(new TimeBlock(now, Duration.Hour));
            Assert.Equal <DateTime>(timePeriods.Start, now);

            timePeriods.Clear();
            Assert.Equal(timePeriods.Start, TimeSpec.MinPeriodDate);
        }         // StartTest
Exemplo n.º 3
0
        public void EndTest()
        {
            var now   = ClockProxy.Clock.Now;
            var chain = new TimePeriodChain();

            chain.End.Should().Be(TimeSpec.MaxPeriodTime);

            chain.Add(new TimeBlock(DurationUtil.Hour, now));
            chain.End.Should().Be(now);

            chain.Clear();
            chain.End.Should().Be(TimeSpec.MaxPeriodTime);
        }
Exemplo n.º 4
0
        public void HasStartTest()
        {
            TimePeriodChain timePeriods = new TimePeriodChain();

            Assert.False(timePeriods.HasStart);

            timePeriods.Add(new TimeBlock(TimeSpec.MinPeriodDate, Duration.Hour));
            Assert.False(timePeriods.HasStart);

            timePeriods.Clear();
            timePeriods.Add(new TimeBlock(ClockProxy.Clock.Now, Duration.Hour));
            Assert.True(timePeriods.HasStart);
        }         // HasStartTest
Exemplo n.º 5
0
        public void StartTest()
        {
            var now   = ClockProxy.Clock.Now;
            var chain = new TimePeriodChain();

            chain.Start.Should().Be(TimeSpec.MinPeriodTime);

            chain.Add(new TimeBlock(now, DurationUtil.Hour));
            chain.Start.Should().Be(now);

            chain.Clear();
            chain.Start.Should().Be(TimeSpec.MinPeriodTime);
        }
Exemplo n.º 6
0
        public void ClearTest()
        {
            TimePeriodChain timePeriods = new TimePeriodChain();

            Assert.Equal(0, timePeriods.Count);
            timePeriods.Clear();
            Assert.Equal(0, timePeriods.Count);

            SchoolDay schoolDay = new SchoolDay();

            Assert.Equal(7, schoolDay.Count);
            schoolDay.Clear();
            Assert.Equal(0, schoolDay.Count);
        }         // ClearTest
Exemplo n.º 7
0
        public void HasEndTest()
        {
            DateTime        now         = ClockProxy.Clock.Now;
            TimePeriodChain timePeriods = new TimePeriodChain();

            Assert.False(timePeriods.HasEnd);

            timePeriods.Add(new TimeBlock(Duration.Hour, TimeSpec.MaxPeriodDate));
            Assert.False(timePeriods.HasEnd);

            timePeriods.Clear();
            timePeriods.Add(new TimeBlock(now, Duration.Hour));
            Assert.True(timePeriods.HasEnd);
        }         // HasEndTest
Exemplo n.º 8
0
        public void ClearTest()
        {
            var timePeriods = new TimePeriodChain();

            Assert.AreEqual(timePeriods.Count, 0);
            timePeriods.Clear();
            Assert.AreEqual(timePeriods.Count, 0);

            SchoolDay schoolDay = new SchoolDay();

            Assert.AreEqual(schoolDay.Count, 7);
            schoolDay.Clear();
            Assert.AreEqual(schoolDay.Count, 0);
        }
Exemplo n.º 9
0
        public void ClearTest() {
            var timePeriods = new TimePeriodChain();
            Assert.AreEqual(timePeriods.Count, 0);
            timePeriods.Clear();
            Assert.AreEqual(timePeriods.Count, 0);

            SchoolDay schoolDay = new SchoolDay();
            Assert.AreEqual(schoolDay.Count, 7);
            schoolDay.Clear();
            Assert.AreEqual(schoolDay.Count, 0);
        }
Exemplo n.º 10
0
        public void EndTest() {
            var now = ClockProxy.Clock.Now;
            var chain = new TimePeriodChain();

            chain.End.Should().Be(TimeSpec.MaxPeriodTime);

            chain.Add(new TimeBlock(DurationUtil.Hour, now));
            chain.End.Should().Be(now);

            chain.Clear();
            chain.End.Should().Be(TimeSpec.MaxPeriodTime);
        }
Exemplo n.º 11
0
        public void StartTest() {
            var now = ClockProxy.Clock.Now;
            var chain = new TimePeriodChain();

            chain.Start.Should().Be(TimeSpec.MinPeriodTime);

            chain.Add(new TimeBlock(now, DurationUtil.Hour));
            chain.Start.Should().Be(now);

            chain.Clear();
            chain.Start.Should().Be(TimeSpec.MinPeriodTime);
        }