Beispiel #1
0
        public void Add(AddScenario scenario)
        {
            IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List;

            foreach (var item in scenario.ItemsToAdd)
            {
                list.Add(item);
            }

            AssertHelper.AreCollectionSame(scenario.ExpectedElements, list);
        }
Beispiel #2
0
        public void AddPerformance(AddScenario scenario)
        {
            IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List;

            Stopwatch stopwatch = Stopwatch.StartNew();

            foreach (var item in scenario.ItemsToAdd)
            {
                list.Add(item);
            }
            stopwatch.Stop();

            this.SaveResultsToFile(
                list.GetType(),
                MethodBase.GetCurrentMethod().Name,
                scenario.ItemsToAdd.Length,
                stopwatch.ElapsedMilliseconds);
        }