src/GenFx.Tests/PopulationTest.cs
/// <summary>
/// Tests that the constructor initializes the state correctly.
/// </summary>
Tests that the constructor initializes the state correctly.
Tests that the constructor initializes the state correctly .
[Fact]
        public void Population_Ctor()
        {
            GeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MockFitnessEvaluator(),
                GeneticEntitySeed = new MockEntity(),
                PopulationSeed = new MockPopulation(),
            };
            Population population = new MockPopulation();
            population.Initialize(algorithm);
            PrivateObject accessor = new PrivateObject(population);
            Assert.Same(algorithm, accessor.GetProperty("Algorithm"));
        }
[ Fact ] public void Population_Ctor ( ) { GeneticAlgorithm algorithm = new MockGeneticAlgorithm { SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MockFitnessEvaluator ( ) , GeneticEntitySeed = new MockEntity ( ) , PopulationSeed = new MockPopulation ( ) , } ; Population population = new MockPopulation ( ) ; population . Initialize ( algorithm ) ; PrivateObject accessor = new PrivateObject ( population ) ; Assert . Same ( algorithm , accessor . GetProperty ( " " ) ) ; }
Tests that the constructor initializes the state correctly.
Tests that the constructor initializes the state correctly .