public void QueryRangeItemTest() { RangeCollection <MyRangeItem> collection = new RangeCollection <MyRangeItem>(); collection.Add(new MyRangeItem(1, 10)); var result = collection.Get(1).ToList(); Assert.IsTrue(result[0].start == 1 && result[0].length == 10); result = collection.Get(0, 20).ToList(); Assert.IsTrue(result[0].start == 1 && result[0].length == 10); collection.Add(new MyRangeItem(15, 10)); result = collection.Get(0, 20).ToList(); Assert.IsTrue(result[0].start == 1 && result[0].length == 10); Assert.IsTrue(result[1].start == 15 && result[0].length == 10); }