src/GenFx.Tests/FitnessEvaluatorTest.cs
/// <summary>
/// Tests that the EvaluateFitness method works correctly.
/// </summary>
Tests that the EvaluateFitness method works correctly.
Tests that the EvaluateFitness method works correctly .
[Fact]
        public async Task FitnessEvaluator_EvaluateFitness_Async()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                SelectionOperator = new MockSelectionOperator(),
                PopulationSeed = new MockPopulation(),
                GeneticEntitySeed = new MockEntity(),
                FitnessEvaluator = new FakeFitnessEvaluator2()
            };
            FakeFitnessEvaluator2 evaluator = new FakeFitnessEvaluator2();
            evaluator.Initialize(algorithm);
            MockEntity entity = new MockEntity();
            entity.Initialize(algorithm);
            double actualVal = await evaluator.EvaluateFitnessAsync(entity);
            Assert.Equal((double)99, actualVal);
        }
[ Fact ] public async Task FitnessEvaluator_EvaluateFitness_Async ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm { SelectionOperator = new MockSelectionOperator ( ) , PopulationSeed = new MockPopulation ( ) , GeneticEntitySeed = new MockEntity ( ) , FitnessEvaluator = new FakeFitnessEvaluator2 ( ) } ; FakeFitnessEvaluator2 evaluator = new FakeFitnessEvaluator2 ( ) ; evaluator . Initialize ( algorithm ) ; MockEntity entity = new MockEntity ( ) ; entity . Initialize ( algorithm ) ; double actualVal = await evaluator . EvaluateFitnessAsync ( entity ) ; Assert . Equal ( ( double ) 99 , actualVal ) ; }
Tests that the EvaluateFitness method works correctly.
Tests that the EvaluateFitness method works correctly .