src/GenFx.Tests/GeneticAlgorithmTest.cs
/// <summary>
/// Tests that an exception is thrown when calling Run without first calling Initialize.
/// </summary>
Tests that an exception is thrown when calling Run without first calling Initialize.
Tests that an exception is thrown when calling Run without first calling Initialize .
[Fact]
        public async Task GeneticAlgorithm_Step_NoInitialize_Async()
        {
            TestGeneticAlgorithm algorithm = new TestGeneticAlgorithm
            {
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MockFitnessEvaluator(),
                GeneticEntitySeed = new MockEntity(),
                PopulationSeed = new MockPopulation()
            };
            await Assert.ThrowsAsync<InvalidOperationException>(async () => await algorithm.StepAsync());
        }
[ Fact ] public async Task GeneticAlgorithm_Step_NoInitialize_Async ( ) { TestGeneticAlgorithm algorithm = new TestGeneticAlgorithm { SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MockFitnessEvaluator ( ) , GeneticEntitySeed = new MockEntity ( ) , PopulationSeed = new MockPopulation ( ) } ; await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) => await algorithm . StepAsync ( ) ) ; }
Tests that an exception is thrown when calling Run without first calling Initialize.
Tests that an exception is thrown when calling Run without first calling Initialize .