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_InvalidMutationOperator()
        {
            MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MutationOperatorDependentFitnessEvaluator2(),
                GeneticEntitySeed = new MockEntity(),
                PopulationSeed = new MockPopulation(),
                MutationOperator = new MockMutationOperator
                {
                    MutationRate = 1
                }
            };
            this.ValidateComponent(algorithm.FitnessEvaluator, algorithm, true);
        }
[ Fact ] public void GeneticAlgorithm_ValidateConfiguration_InvalidMutationOperator ( ) { MockGeneticAlgorithm algorithm = new MockGeneticAlgorithm { SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MutationOperatorDependentFitnessEvaluator2 ( ) , GeneticEntitySeed = new MockEntity ( ) , PopulationSeed = new MockPopulation ( ) , MutationOperator = new MockMutationOperator { MutationRate = 1 } } ; this . ValidateComponent ( algorithm . FitnessEvaluator , 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 .