public void MergeWithSingleResult() { var ranges = new IndexRange[] { new IndexRange(0, 6), }; var otherRange = new IndexRange(4, 7); var mergedRanges = ranges.Merge(otherRange); Assert.Single(mergedRanges); Assert.Equal(new IndexRange(0, 7), mergedRanges[0]); }
public void MergeWithManyResult() { var ranges = new IndexRange[] { new IndexRange(0, 4), new IndexRange(9, 10), }; var otherRange = new IndexRange(7, 13); var mergedRanges = ranges.Merge(otherRange); Assert.Collection(mergedRanges, x => Assert.Equal(ranges[0], x), x => Assert.Equal(new IndexRange(7, 13), x)); }