src/GenFx.Tests/GeneticAlgorithmTest.cs
/// <summary>
/// Tests that an exception is thrown when Step is called too many times with no initialize in between.
/// </summary>
Tests that an exception is thrown when Step is called too many times with no initialize in between.
Tests that an exception is thrown when Step is called too many times with no initialize in between .
[Fact]
        public async Task GeneticAlgorithm_Step_Overbounds_NoInitialize_Async()
        {
            TestGeneticAlgorithm algorithm = GetAlgorithm();
            await algorithm.InitializeAsync();
            bool result = await algorithm.StepAsync();
            Assert.False(result, "Algorithm should not be complete.");
            result = await algorithm.StepAsync();
            Assert.False(result, "Algorithm should not be complete.");
            result = await algorithm.StepAsync();
            Assert.True(result, "Algorithm should be complete.");
            await Assert.ThrowsAsync<InvalidOperationException>(async () => await algorithm.StepAsync());
        }
[ Fact ] public async Task GeneticAlgorithm_Step_Overbounds_NoInitialize_Async ( ) { TestGeneticAlgorithm algorithm = GetAlgorithm ( ) ; await algorithm . InitializeAsync ( ) ; bool result = await algorithm . StepAsync ( ) ; Assert . False ( result , " " ) ; result = await algorithm . StepAsync ( ) ; Assert . False ( result , " " ) ; result = await algorithm . StepAsync ( ) ; Assert . True ( result , " " ) ; await Assert . ThrowsAsync < InvalidOperationException > ( async ( ) => await algorithm . StepAsync ( ) ) ; }
Tests that an exception is thrown when Step is called too many times with no initialize in between.
Tests that an exception is thrown when Step is called too many times with no initialize in between .