src/GenFx.Tests/ElitismStrategyTest.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 ElitismStrategy_GetElitistGeneticEntities_EmptyPopulation()
        {
            GeneticAlgorithm algorithm = GetGeneticAlgorithm(.1);
            MockElitismStrategy strategy = new MockElitismStrategy();
            strategy.Initialize(algorithm);
            MockPopulation pop = new MockPopulation();
            pop.Initialize(algorithm);
            Assert.Throws<ArgumentException>(() => strategy.GetEliteEntities(pop));
        }
[ Fact ] public void ElitismStrategy_GetElitistGeneticEntities_EmptyPopulation ( ) { GeneticAlgorithm algorithm = GetGeneticAlgorithm ( .1 ) ; MockElitismStrategy strategy = new MockElitismStrategy ( ) ; strategy . Initialize ( algorithm ) ; MockPopulation pop = new MockPopulation ( ) ; pop . Initialize ( algorithm ) ; Assert . Throws < ArgumentException > ( ( ) => strategy . GetEliteEntities ( pop ) ) ; }
Tests that an exception is thrown when an empty population is passed.
Tests that an exception is thrown when an empty population is passed .