public void IntersectsWithTest() { var now = ClockProxy.Clock.Now; var offset = DurationUtil.Second; var testData = new TimeRangePeriodRelationTestData(now, now.AddHours(1), offset); var timePeriods = new TimePeriodCollection { testData.Reference }; Assert.IsFalse(timePeriods.IntersectsWith(testData.Before)); Assert.IsTrue(timePeriods.IntersectsWith(testData.StartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.StartInside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.InsideStartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EnclosingStartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.Enclosing)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EnclosingEndTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.ExactMatch)); Assert.IsTrue(timePeriods.IntersectsWith(testData.Inside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.InsideEndTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EndInside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EndTouching)); Assert.IsFalse(timePeriods.IntersectsWith(testData.After)); }
public void IntersectsWithTest() { 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.False(timePeriods.IntersectsWith(testData.Before)); Assert.True(timePeriods.IntersectsWith(testData.StartTouching)); Assert.True(timePeriods.IntersectsWith(testData.StartInside)); Assert.True(timePeriods.IntersectsWith(testData.InsideStartTouching)); Assert.True(timePeriods.IntersectsWith(testData.EnclosingStartTouching)); Assert.True(timePeriods.IntersectsWith(testData.Enclosing)); Assert.True(timePeriods.IntersectsWith(testData.EnclosingEndTouching)); Assert.True(timePeriods.IntersectsWith(testData.ExactMatch)); Assert.True(timePeriods.IntersectsWith(testData.Inside)); Assert.True(timePeriods.IntersectsWith(testData.InsideEndTouching)); Assert.True(timePeriods.IntersectsWith(testData.EndInside)); Assert.True(timePeriods.IntersectsWith(testData.EndTouching)); Assert.False(timePeriods.IntersectsWith(testData.After)); } // IntersectsWithTest
public void IntersectsWithTest() { var now = ClockProxy.Clock.Now; var offset = DurationUtil.Second; var testData = new TimeRangePeriodRelationTestData(now, now.AddHours(1), offset); var timePeriods = new TimePeriodCollection { testData.Reference }; Assert.IsFalse(timePeriods.IntersectsWith(testData.Before)); Assert.IsTrue(timePeriods.IntersectsWith(testData.StartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.StartInside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.InsideStartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EnclosingStartTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.Enclosing)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EnclosingEndTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.ExactMatch)); Assert.IsTrue(timePeriods.IntersectsWith(testData.Inside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.InsideEndTouching)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EndInside)); Assert.IsTrue(timePeriods.IntersectsWith(testData.EndTouching)); Assert.IsFalse(timePeriods.IntersectsWith(testData.After)); }