コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }