src/GenFx.Tests/TerminatorTest.cs
/// <summary>
/// Tests that the constructor initializes the state correctly.
/// </summary>
Tests that the constructor initializes the state correctly.
Tests that the constructor initializes the state correctly .
[Fact]
        public void Terminator_Ctor()
        {
            GeneticAlgorithm algorithm = new MockGeneticAlgorithm
            {
                GeneticEntitySeed = new MockEntity(),
                PopulationSeed = new MockPopulation(),
                SelectionOperator = new MockSelectionOperator(),
                FitnessEvaluator = new MockFitnessEvaluator(),
                Terminator = new MockTerminator()
            };
            MockTerminator terminator = new MockTerminator();
            terminator.Initialize(algorithm);
            PrivateObject accessor = new PrivateObject(terminator, new PrivateType(typeof(Terminator)));
            Assert.Same(algorithm, accessor.GetProperty("Algorithm"));
        }
[ Fact ] public void Terminator_Ctor ( ) { GeneticAlgorithm algorithm = new MockGeneticAlgorithm { GeneticEntitySeed = new MockEntity ( ) , PopulationSeed = new MockPopulation ( ) , SelectionOperator = new MockSelectionOperator ( ) , FitnessEvaluator = new MockFitnessEvaluator ( ) , Terminator = new MockTerminator ( ) } ; MockTerminator terminator = new MockTerminator ( ) ; terminator . Initialize ( algorithm ) ; PrivateObject accessor = new PrivateObject ( terminator , new PrivateType ( typeof ( Terminator ) ) ) ; Assert . Same ( algorithm , accessor . GetProperty ( " " ) ) ; }
Tests that the constructor initializes the state correctly.
Tests that the constructor initializes the state correctly .