src/GenFx.Components.Tests/MeanFitnessTest.cs
/// <summary>
/// Tests that the <see cref="MeanFitness.GetResultValue"/> method works correctly.
/// </summary>
Tests that the  method works correctly.
Tests that the method works correctly .
[Fact]
        public void MeanFitness_GetResultValue_WithScaling()
        {
            MeanFitness metric = new MeanFitness();
            metric.Initialize(new MockGeneticAlgorithm { FitnessScalingStrategy = new MockFitnessScalingStrategy() });
            MockPopulation population = new MockPopulation();
            population.Entities.Add(new MockEntity { ScaledFitnessValue = 10 });
            population.Entities.Add(new MockEntity { ScaledFitnessValue = 11 });
            population.Entities.Add(new MockEntity { ScaledFitnessValue = 15 });
            population.Entities.Add(new MockEntity { ScaledFitnessValue = 13 });
            object result = metric.GetResultValue(population);
            Assert.Equal(12.25, result);
        }
[ Fact ] public void MeanFitness_GetResultValue_WithScaling ( ) { MeanFitness metric = new MeanFitness ( ) ; metric . Initialize ( new MockGeneticAlgorithm { FitnessScalingStrategy = new MockFitnessScalingStrategy ( ) } ) ; MockPopulation population = new MockPopulation ( ) ; population . Entities . Add ( new MockEntity { ScaledFitnessValue = 10 } ) ; population . Entities . Add ( new MockEntity { ScaledFitnessValue = 11 } ) ; population . Entities . Add ( new MockEntity { ScaledFitnessValue = 15 } ) ; population . Entities . Add ( new MockEntity { ScaledFitnessValue = 13 } ) ; object result = metric . GetResultValue ( population ) ; Assert . Equal ( 12.25 , result ) ; }
Tests that the  method works correctly.
Tests that the method works correctly .