/// <summary>
 /// Initializes a new instance of the <see cref="AutoConfigFitness"/> class.
 /// </summary>
 /// <param name="targetFitness">The target fitness.</param>
 /// <param name="targetChromosome">The target chromosome.</param>
 public AutoConfigFitness(IFitness targetFitness, IChromosome targetChromosome)
 {
     m_targetFitness = targetFitness;
     m_targetChromosome = targetChromosome;
     PopulationMinSize = 100;
     PopulationMaxSize = 100;
     Termination = new TimeEvolvingTermination(TimeSpan.FromSeconds(30));
     TaskExecutor = new LinearTaskExecutor();
 }
        public void HasReached_TimeLowerThanMaxTime_False()
        {
            var repository = new MockRepository ();
            var ga = repository.StrictMock<IGeneticAlgorithm> ();

            using (repository.Ordered()) {
                ga.Expect (g => g.TimeEvolving).Return (TimeSpan.FromSeconds(0.1));
                ga.Expect (g => g.TimeEvolving).Return (TimeSpan.FromSeconds(0.9));
            }
            repository.ReplayAll ();

            var target = new TimeEvolvingTermination (TimeSpan.FromSeconds(1));
            Assert.IsFalse(target.HasReached(ga));
            Assert.IsFalse(target.HasReached(ga));
        }