public void NTreeDeletesNonUniqueBySegment() { var objs = TestResourceFactory.GetMockClassAObjects(50).ToList(); var seedIndex = new Seed32(); var seedSegment = new Seed64(); objs.ForEach(o => o.Id = seedIndex.Increment()); using (var tree = new NTree<int, MockClassA, long>("Id", false)) { foreach (var o in objs) tree.AddOrUpdate(new Tuple<MockClassA, long>(o, seedSegment.Increment())); Assert.AreEqual(50, tree.Length); Assert.AreEqual(5, tree.GetFirstByIndex(5)); Assert.AreEqual(5, tree.GetFirstBySegment(5)); Assert.AreEqual(1, tree.GetByIndex(5).Count()); tree.DeleteBySegment(11); Assert.AreEqual(50, tree.Length); Assert.AreEqual(0, tree.GetFirstByIndex(objs[10].Id)); } }