public void TestRescanWorks() { PrioritizedElementsContainer <int> testInst = new PrioritizedElementsContainer <int>(new PoolElementComparer()); try { for (int i = 0; i < 10; i++) { testInst.Add(i, new PoolOperations(), true); } testInst.ProcessAllElements(o => o.MarkElementDestroyed()); testInst.RescanContainer(); Assert.AreEqual(0, testInst.Count); Assert.AreEqual(0, testInst.AvailableCount); } finally { testInst.ProcessAllElements(o => o.MarkElementDestroyed()); } }