Ejemplo n.º 1
0
        private static void checkAccums()
        {
            IBenchmark benchmark;
            List <int> accums;

            benchmark = new InitialBenchmark();
            benchmark.Setup();
            accums = new List <int>
            {
                benchmark.LtQuery(),
                    benchmark.EFCore(),
                    benchmark.Dapper(),
                //benchmark.Mongo()
            };
            benchmark.Cleanup();
            if (accums.Distinct().Count() != 1)
            {
                throw new Exception($"{benchmark.GetType().Name}: Not match accums");
            }

            benchmark = new SelectOneBenchmark();
            benchmark.Setup();
            accums = new List <int>
            {
                benchmark.LtQuery(),
                    benchmark.EFCore(),
                    benchmark.Dapper(),
                //benchmark.Mongo()
            };
            benchmark.Cleanup();
            if (accums.Distinct().Count() != 1)
            {
                throw new Exception($"{benchmark.GetType().Name}: Not match accums");
            }

            benchmark = new SelectAllBenchmark();
            benchmark.Setup();
            accums = new List <int>
            {
                benchmark.LtQuery(),
                    benchmark.EFCore(),
                    benchmark.Dapper(),
                //benchmark.Mongo()
            };
            benchmark.Cleanup();
            if (accums.Distinct().Count() != 1)
            {
                throw new Exception($"{benchmark.GetType().Name}: Not match accums");
            }
        }
Ejemplo n.º 2
0
 static void Main()
 {
     SelectAllBenchmark.Run();
     SelectByIndexBenchmark.Run();
 }