src/GenFx.Tests/GeneticAlgorithmTest.cs
/// <summary>
/// Tests that an exception is throw when an required configurable type has not been set on the algorithm.
/// </summary>
Tests that an exception is throw when an required configurable type has not been set on the algorithm.
Tests that an exception is throw when an required configurable type has not been set on the algorithm .
[Fact]
        public void GeneticAlgorithm_ValidateConfiguration_InvalidSelectionOperator()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                FitnessEvaluator = new MockFitnessEvaluator(),
                GeneticEntitySeed = new MockEntity(),
                PopulationSeed = new MockPopulation(),
                SelectionOperator = new MockSelectionOperator
                {
                    SelectionBasedOnFitnessType = FitnessType.Scaled
                },
                Terminator = new SelectionOperatorDependentTerminator2()
            };
            this.ValidateComponent(algorithm.Terminator, algorithm, true);
        }
[ Fact ] public void GeneticAlgorithm_ValidateConfiguration_InvalidSelectionOperator ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm { FitnessEvaluator = new MockFitnessEvaluator ( ) , GeneticEntitySeed = new MockEntity ( ) , PopulationSeed = new MockPopulation ( ) , SelectionOperator = new MockSelectionOperator { SelectionBasedOnFitnessType = FitnessType . Scaled } , Terminator = new SelectionOperatorDependentTerminator2 ( ) } ; this . ValidateComponent ( algorithm . Terminator , algorithm , true ) ; }
Tests that an exception is throw when an required configurable type has not been set on the algorithm.
Tests that an exception is throw when an required configurable type has not been set on the algorithm .