src/GenFx.Tests/GeneticAlgorithmTest.cs
/// <summary>
/// Tests that the InitializeAsync initializes the state correctly.
/// </summary>
Tests that the InitializeAsync initializes the state correctly.
Tests that the InitializeAsync initializes the state correctly .
[Fact]
        public async Task GeneticAlgorithm_InitializeAsync()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MockFitnessEvaluator(),
                PopulationSeed = new MockPopulation(),
                GeneticEntitySeed = new MockEntity()
            };
            await algorithm.InitializeAsync();
            Assert.NotNull(algorithm.Environment);
            PrivateObject accessor = new PrivateObject(algorithm.Environment);
            Assert.Same(algorithm, accessor.GetField("algorithm"));
            Assert.IsType<DefaultTerminator>(algorithm.Terminator);
        }
[ Fact ] public async Task GeneticAlgorithm_InitializeAsync ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm { SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MockFitnessEvaluator ( ) , PopulationSeed = new MockPopulation ( ) , GeneticEntitySeed = new MockEntity ( ) } ; await algorithm . InitializeAsync ( ) ; Assert . NotNull ( algorithm . Environment ) ; PrivateObject accessor = new PrivateObject ( algorithm . Environment ) ; Assert . Same ( algorithm , accessor . GetField ( " " ) ) ; Assert . IsType < DefaultTerminator > ( algorithm . Terminator ) ; }
Tests that the InitializeAsync initializes the state correctly.
Tests that the InitializeAsync initializes the state correctly .