Beispiel #1
0
        public void TimeBlockPeriodRelationTestDataTest()
        {
            DateTime now      = ClockProxy.Clock.Now;
            TimeSpan duration = Duration.Hour;
            DateTime start    = now;
            DateTime end      = start.Add(duration);
            TimeSpan offset   = Duration.Minute;

            TimeBlockPeriodRelationTestData testData = new TimeBlockPeriodRelationTestData(start, duration, offset);

            Assert.Equal(testData.Reference, new TimeBlock(start, end, true));
            Assert.Equal(PeriodRelation.Before, testData.Reference.GetRelation(testData.Before));
            Assert.Equal(PeriodRelation.StartTouching, testData.Reference.GetRelation(testData.StartTouching));
            Assert.Equal(PeriodRelation.StartInside, testData.Reference.GetRelation(testData.StartInside));
            Assert.Equal(PeriodRelation.InsideStartTouching, testData.Reference.GetRelation(testData.InsideStartTouching));
            Assert.Equal(PeriodRelation.EnclosingStartTouching, testData.Reference.GetRelation(testData.EnclosingStartTouching));
            Assert.Equal(PeriodRelation.Inside, testData.Reference.GetRelation(testData.Inside));
            Assert.Equal(PeriodRelation.EnclosingEndTouching, testData.Reference.GetRelation(testData.EnclosingEndTouching));
            Assert.Equal(PeriodRelation.ExactMatch, testData.Reference.GetRelation(testData.ExactMatch));
            Assert.Equal(PeriodRelation.Enclosing, testData.Reference.GetRelation(testData.Enclosing));
            Assert.Equal(PeriodRelation.InsideEndTouching, testData.Reference.GetRelation(testData.InsideEndTouching));
            Assert.Equal(PeriodRelation.EndInside, testData.Reference.GetRelation(testData.EndInside));
            Assert.Equal(PeriodRelation.EndTouching, testData.Reference.GetRelation(testData.EndTouching));
            Assert.Equal(PeriodRelation.After, testData.Reference.GetRelation(testData.After));
        }         // TimeBlockPeriodRelationTestDataTest
Beispiel #2
0
 public TimeBlockTest()
 {
     start    = ClockProxy.Clock.Now;
     end      = start.Add(duration);
     testData = new TimeBlockPeriodRelationTestData(start, duration, offset);
 }         // TimeBlockTest