public void Remove(RemoveScenario scenario) { IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List; bool wasRemoved = list.Remove(scenario.ToRemove); Assert.AreEqual(scenario.ExpectedRemoved, wasRemoved); AssertHelper.AreCollectionSame(scenario.ExpectedElements, list); }
public void RemovePerformance(RemovePerformanceScenario scenario) { IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List; Stopwatch stopwatch = Stopwatch.StartNew(); foreach (var item in scenario.ToRemove) { list.Remove(item); } stopwatch.Stop(); this.SaveResultsToFile( list.GetType(), MethodBase.GetCurrentMethod().Name, list.Count, stopwatch.ElapsedMilliseconds); }