src/GenFx.Tests/CrossoverOperatorTest.cs
/// <summary>
/// Tests that an exception is thrown when null is returned by the derived <see cref="CrossoverOperator.GenerateCrossover(IList{GeneticEntity})"/> method.
/// </summary>
Tests that an exception is thrown when null is returned by the derived  method.
Tests that an exception is thrown when null is returned by the derived method .
[Fact]
        public void CrossoverOperator_NullCrossoverResult()
        {
            MockCrossoverOperator3 op = new MockCrossoverOperator3
            {
                CrossoverRate = 1
            };
            List<GeneticEntity> parents = new List<GeneticEntity>
            {
                new MockEntity(),
                new MockEntity(),
            };
            Assert.Throws<InvalidOperationException>(() => op.Crossover(parents));
            Assert.True(op.GenerateCrossoverCalled);
        }
[ Fact ] public void CrossoverOperator_NullCrossoverResult ( ) { MockCrossoverOperator3 op = new MockCrossoverOperator3 { CrossoverRate = 1 } ; List < GeneticEntity > parents = new List < GeneticEntity > { new MockEntity ( ) , new MockEntity ( ) , } ; Assert . Throws < InvalidOperationException > ( ( ) => op . Crossover ( parents ) ) ; Assert . True ( op . GenerateCrossoverCalled ) ; }
Tests that an exception is thrown when null is returned by the derived  method.
Tests that an exception is thrown when null is returned by the derived method .