src/GenFx.Tests/ElitismStrategyTest.cs
/// <summary>
/// Tests that an exception is thrown when a null population is passed to <see cref="ElitismStrategy.GetEliteGeneticEntitiesCore(Population)"/>.
/// </summary>
Tests that an exception is thrown when a null population is passed to .
Tests that an exception is thrown when a null population is passed to .
[Fact]
        public void ElitismStrategy_NullPopulation()
        {
            MockElitismStrategy3 strategy = new MockElitismStrategy3();
            MockPopulation population = new MockPopulation();
            population.Entities.Add(new MockEntity());
            Assert.Throws<ArgumentNullException>(() => strategy.GetEliteEntities(population));
            Assert.True(strategy.GetEliteGeneticEntitiesCoreCalled);
        }
[ Fact ] public void ElitismStrategy_NullPopulation ( ) { MockElitismStrategy3 strategy = new MockElitismStrategy3 ( ) ; MockPopulation population = new MockPopulation ( ) ; population . Entities . Add ( new MockEntity ( ) ) ; Assert . Throws < ArgumentNullException > ( ( ) => strategy . GetEliteEntities ( population ) ) ; Assert . True ( strategy . GetEliteGeneticEntitiesCoreCalled ) ; }
Tests that an exception is thrown when a null population is passed to .
Tests that an exception is thrown when a null population is passed to .