public void GetRelationTest() { var now = ClockProxy.Clock.Now; var offset = DurationUtil.Second; var testData = new TimeRangePeriodRelationTestData(now, now.AddHours(1), offset); var timePeriods = new TimePeriodCollection { testData.Reference }; timePeriods.GetRelation(testData.Before).Should().Be(PeriodRelation.Before); timePeriods.GetRelation(testData.StartTouching).Should().Be(PeriodRelation.StartTouching); timePeriods.GetRelation(testData.StartInside).Should().Be(PeriodRelation.StartInside); timePeriods.GetRelation(testData.InsideStartTouching).Should().Be(PeriodRelation.InsideStartTouching); timePeriods.GetRelation(testData.EnclosingStartTouching).Should().Be(PeriodRelation.EnclosingStartTouching); timePeriods.GetRelation(testData.Enclosing).Should().Be(PeriodRelation.Enclosing); timePeriods.GetRelation(testData.EnclosingEndTouching).Should().Be(PeriodRelation.EnclosingEndTouching); timePeriods.GetRelation(testData.ExactMatch).Should().Be(PeriodRelation.ExactMatch); timePeriods.GetRelation(testData.Inside).Should().Be(PeriodRelation.Inside); timePeriods.GetRelation(testData.InsideEndTouching).Should().Be(PeriodRelation.InsideEndTouching); timePeriods.GetRelation(testData.EndInside).Should().Be(PeriodRelation.EndInside); timePeriods.GetRelation(testData.EndTouching).Should().Be(PeriodRelation.EndTouching); timePeriods.GetRelation(testData.After).Should().Be(PeriodRelation.After); }
public void GetRelationTest() { DateTime now = ClockProxy.Clock.Now; TimeSpan offset = Duration.Second; TimeRangePeriodRelationTestData testData = new TimeRangePeriodRelationTestData(now, now.AddHours(1), offset); TimePeriodCollection timePeriods = new TimePeriodCollection(); timePeriods.Add(testData.Reference); Assert.Equal(PeriodRelation.Before, timePeriods.GetRelation(testData.Before)); Assert.Equal(PeriodRelation.StartTouching, timePeriods.GetRelation(testData.StartTouching)); Assert.Equal(PeriodRelation.StartInside, timePeriods.GetRelation(testData.StartInside)); Assert.Equal(PeriodRelation.InsideStartTouching, timePeriods.GetRelation(testData.InsideStartTouching)); Assert.Equal(PeriodRelation.EnclosingStartTouching, timePeriods.GetRelation(testData.EnclosingStartTouching)); Assert.Equal(PeriodRelation.Enclosing, timePeriods.GetRelation(testData.Enclosing)); Assert.Equal(PeriodRelation.EnclosingEndTouching, timePeriods.GetRelation(testData.EnclosingEndTouching)); Assert.Equal(PeriodRelation.ExactMatch, timePeriods.GetRelation(testData.ExactMatch)); Assert.Equal(PeriodRelation.Inside, timePeriods.GetRelation(testData.Inside)); Assert.Equal(PeriodRelation.InsideEndTouching, timePeriods.GetRelation(testData.InsideEndTouching)); Assert.Equal(PeriodRelation.EndInside, timePeriods.GetRelation(testData.EndInside)); Assert.Equal(PeriodRelation.EndTouching, timePeriods.GetRelation(testData.EndTouching)); Assert.Equal(PeriodRelation.After, timePeriods.GetRelation(testData.After)); } // GetRelationTest
public void GetRelationTest() { var now = ClockProxy.Clock.Now; var offset = DurationUtil.Second; var testData = new TimeRangePeriodRelationTestData(now, now.AddHours(1), offset); var timePeriods = new TimePeriodCollection { testData.Reference }; timePeriods.GetRelation(testData.Before).Should().Be(PeriodRelation.Before); timePeriods.GetRelation(testData.StartTouching).Should().Be(PeriodRelation.StartTouching); timePeriods.GetRelation(testData.StartInside).Should().Be(PeriodRelation.StartInside); timePeriods.GetRelation(testData.InsideStartTouching).Should().Be(PeriodRelation.InsideStartTouching); timePeriods.GetRelation(testData.EnclosingStartTouching).Should().Be(PeriodRelation.EnclosingStartTouching); timePeriods.GetRelation(testData.Enclosing).Should().Be(PeriodRelation.Enclosing); timePeriods.GetRelation(testData.EnclosingEndTouching).Should().Be(PeriodRelation.EnclosingEndTouching); timePeriods.GetRelation(testData.ExactMatch).Should().Be(PeriodRelation.ExactMatch); timePeriods.GetRelation(testData.Inside).Should().Be(PeriodRelation.Inside); timePeriods.GetRelation(testData.InsideEndTouching).Should().Be(PeriodRelation.InsideEndTouching); timePeriods.GetRelation(testData.EndInside).Should().Be(PeriodRelation.EndInside); timePeriods.GetRelation(testData.EndTouching).Should().Be(PeriodRelation.EndTouching); timePeriods.GetRelation(testData.After).Should().Be(PeriodRelation.After); }