Esempio n. 1
0
        public void DurationFromStartTest()
        {
            TimeBlock timeBlock = new TimeBlock(_start, _duration);

            Assert.AreEqual(timeBlock.Start, _start);
            Assert.AreEqual(timeBlock.End, _end);
            Assert.AreEqual(timeBlock.Duration, _duration);

            TimeSpan delta       = TimeSpan.FromHours(1);
            TimeSpan newDuration = timeBlock.Duration + delta;

            timeBlock.DurationFromStart(newDuration);
            Assert.AreEqual(timeBlock.Start, _start);
            Assert.AreEqual(timeBlock.End, _end.Add(delta));
            Assert.AreEqual(timeBlock.Duration, newDuration);

            timeBlock.DurationFromStart(TimeSpec.MinPeriodDuration);
            Assert.AreEqual(timeBlock.Duration, TimeSpec.MinPeriodDuration);
        }
Esempio n. 2
0
        public void DurationFromStartTest()
        {
            TimeBlock timeBlock = new TimeBlock(start, duration);

            Assert.Equal(timeBlock.Start, start);
            Assert.Equal(timeBlock.End, end);
            Assert.Equal(timeBlock.Duration, duration);

            TimeSpan delta       = Duration.Hour;
            TimeSpan newDuration = timeBlock.Duration + delta;

            timeBlock.DurationFromStart(newDuration);
            Assert.Equal(timeBlock.Start, start);
            Assert.Equal(timeBlock.End, end.Add(delta));
            Assert.Equal(timeBlock.Duration, newDuration);

            timeBlock.DurationFromStart(TimeSpec.MinPeriodDuration);
            Assert.Equal(timeBlock.Duration, TimeSpec.MinPeriodDuration);
        }         // DurationFromStartTest
Esempio n. 3
0
        public void DurationFromStartTest() {
            TimeBlock timeBlock = new TimeBlock(_start, _duration);
            Assert.AreEqual(timeBlock.Start, _start);
            Assert.AreEqual(timeBlock.End, _end);
            Assert.AreEqual(timeBlock.Duration, _duration);

            TimeSpan delta = TimeSpan.FromHours(1);
            TimeSpan newDuration = timeBlock.Duration + delta;
            timeBlock.DurationFromStart(newDuration);
            Assert.AreEqual(timeBlock.Start, _start);
            Assert.AreEqual(timeBlock.End, _end.Add(delta));
            Assert.AreEqual(timeBlock.Duration, newDuration);

            timeBlock.DurationFromStart(TimeSpec.MinPeriodDuration);
            Assert.AreEqual(timeBlock.Duration, TimeSpec.MinPeriodDuration);
        }