src/GenFx.Tests/FitnessScalingStrategyTest.cs
/// <summary>
/// Tests that an exception is thrown when an empty population is passed.
/// </summary>
Tests that an exception is thrown when an empty population is passed.
Tests that an exception is thrown when an empty population is passed .
[Fact]
        public void FitnessScalingStrategy_Scale_EmptyPopulation()
        {
            GeneticAlgorithm algorithm = GetAlgorithm();
            FakeFitnessScalingStrategy2 strategy = new FakeFitnessScalingStrategy2();
            strategy.Initialize(algorithm);
            MockPopulation population = new MockPopulation();
            population.Initialize(algorithm);
            Assert.Throws<ArgumentException>(() => strategy.Scale(population));
        }
[ Fact ] public void FitnessScalingStrategy_Scale_EmptyPopulation ( ) { GeneticAlgorithm algorithm = GetAlgorithm ( ) ; FakeFitnessScalingStrategy2 strategy = new FakeFitnessScalingStrategy2 ( ) ; strategy . Initialize ( algorithm ) ; MockPopulation population = new MockPopulation ( ) ; population . Initialize ( algorithm ) ; Assert . Throws < ArgumentException > ( ( ) => strategy . Scale ( population ) ) ; }
Tests that an exception is thrown when an empty population is passed.
Tests that an exception is thrown when an empty population is passed .