Пример #1
0
        public void Contains(ContainsScenario scenario)
        {
            IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List;

            bool contains = list.Contains(scenario.ToFind);

            Assert.AreEqual(scenario.Expected, contains);
        }
Пример #2
0
        public void ContainsPerformance(ContainsPerformanceScenario scenario)
        {
            IMyCollection <TestItem> list = (IMyCollection <TestItem>)scenario.List;

            Stopwatch stopwatch = Stopwatch.StartNew();

            foreach (var item in scenario.ToFind)
            {
                list.Contains(item);
            }
            stopwatch.Stop();

            this.SaveResultsToFile(
                list.GetType(),
                MethodBase.GetCurrentMethod().Name,
                list.Count,
                stopwatch.ElapsedMilliseconds);
        }