public void PTreeDeletesByIndexIndividualUnique() { _testName = MethodInfo.GetCurrentMethod().Name.GetHashCode().ToString(); Cleanup(); 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 PTree<int, MockClassA, long>("Id", _testName + ".index", true)) { tree.Load(); 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()); Assert.AreEqual(1, tree.Delete(5).Length); Assert.AreEqual(50, tree.Length); Assert.AreEqual(0, tree.GetFirstByIndex(5)); } }