public void GetCurrentPopulation_CheckPopulationIsRight(bool includeHistory)
        {
            var populationManager = new TestPopulationManager(new double[] { 2, 2 });

            populationManager.SetPopulationGenerated(new[] { new double[] { 3, 3 } });
            var engineBuilder =
                new TestGeneticSearchEngineBuilder(2, int.MaxValue, populationManager);

            if (includeHistory)
            {
                engineBuilder.IncludeAllHistory();
            }

            var engine = engineBuilder.Build();

            var result1 = engine.Next();
            var result2 = engine.GetCurrentPopulation();

            Assertions.AssertAreTheSame(result1, result2);

            result1 = engine.Next();
            result2 = engine.GetCurrentPopulation();

            Assertions.AssertAreTheSame(result1, result2);
        }
        public void HistoryExistTest(bool includeHistory, RunType runType)
        {
            var populationManager = new TestPopulationManager(new double[] { 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 });
            var enigneBuilder     = new TestGeneticSearchEngineBuilder(10, 2, populationManager);

            using (var searchEngine = includeHistory ? enigneBuilder.IncludeAllHistory().Build() : enigneBuilder.Build())
            {
                var result = searchEngine.Run(runType);

                if (includeHistory)
                {
                    Assert.AreEqual(2, result.History.Count, "There should have been history");
                }
                else
                {
                    Assert.AreEqual(0, result.History.Count, "There shouldn't be any history");
                }
            }
        }