public void TestMethod1()
        {
            var concurrent = new ConcurrentPrimes();
            concurrent.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);

            PerformanceResult concResult = PerformancePatterns.RunPerformanceTest(cMinPerfIterations,
                (() => concurrent.Execute()));

            Console.WriteLine(cResultFormat + " with concurrent collection.", cMinPerfIterations,
                concResult.TotalMilliseconds,
                concResult.TotalSeconds);

            var plinqed = new PlinqPrimes();
            plinqed.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);

            PerformanceResult pResult = PerformancePatterns.RunPerformanceTest(cMinPerfIterations,
                (() => plinqed.Execute()));

            Console.WriteLine(cResultFormat + " with plinq.", cMinPerfIterations, pResult.TotalMilliseconds,
                pResult.TotalSeconds);

            var comparison = new TwoSampleZTest(pResult.DescriptiveResult, concResult.DescriptiveResult, 0.0,
                TwoSampleHypothesis.FirstValueIsSmallerThanSecond);

            Console.WriteLine(concResult.ToString());
            Console.WriteLine(pResult.ToString());

            Assert.IsTrue(comparison.Significant);
            Assert.AreEqual(concurrent.Primes.Count,plinqed.Primes.Count);
        }
        public void CompareManualConcurrencyVsLinq()
        {
            var concurrent = new ConcurrentPrimes();
            concurrent.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);
            var plinqed = new PlinqPrimes();
            plinqed.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);

            bool significant = PerformancePatterns.RunPerformanceComparison(cMinPerfIterations,
                "concurrent collection", (concurrent.Execute),
                "plinq", (plinqed.Execute),
                250.0, TwoSampleHypothesis.FirstValueIsGreaterThanSecond, true);

            Assert.IsTrue(significant);
            Assert.AreEqual(concurrent.Primes.Count, plinqed.Primes.Count);
        }
        public void CompareManualConcurrencyVsLinq()
        {
            var concurrent = new ConcurrentPrimes();

            concurrent.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);
            var plinqed = new PlinqPrimes();

            plinqed.Init(cMinPrime, cMaxPrime, cDegreeConcurrency);

            bool significant = PerformancePatterns.RunPerformanceComparison(cMinPerfIterations,
                                                                            "concurrent collection", (concurrent.Execute),
                                                                            "plinq", (plinqed.Execute),
                                                                            250.0, TwoSampleHypothesis.FirstValueIsGreaterThanSecond, true);

            Assert.IsTrue(significant);
            Assert.AreEqual(concurrent.Primes.Count, plinqed.Primes.Count);
        }