src/GenFx.Wpf.Tests/PopulationSelectorTest.cs
/// <summary>
/// Tests that the selected population is changed when the index is changed.
/// </summary>
Tests that the selected population is changed when the index is changed.
Tests that the selected population is changed when the index is changed .
[StaFact]
        public void PopulationSelector_SelectedPopulationIndexChanged()
        {
            PopulationSelector selector = new PopulationSelector();
            GeneticEnvironment environment = new GeneticEnvironment(Mock.Of<GeneticAlgorithm>());
            Population population = Mock.Of<Population>();
            environment.Populations.Add(population);
            Population population2 = Mock.Of<Population>();
            environment.Populations.Add(population2);
            selector.Environment = environment;
            Assert.Same(population, selector.SelectedPopulation);
            selector.SelectedPopulationIndex = 1;
            Assert.Same(population2, selector.SelectedPopulation);
        }
[ StaFact ] public void PopulationSelector_SelectedPopulationIndexChanged ( ) { PopulationSelector selector = new PopulationSelector ( ) ; GeneticEnvironment environment = new GeneticEnvironment ( Mock . Of < GeneticAlgorithm > ( ) ) ; Population population = Mock . Of < Population > ( ) ; environment . Populations . Add ( population ) ; Population population2 = Mock . Of < Population > ( ) ; environment . Populations . Add ( population2 ) ; selector . Environment = environment ; Assert . Same ( population , selector . SelectedPopulation ) ; selector . SelectedPopulationIndex = 1 ; Assert . Same ( population2 , selector . SelectedPopulation ) ; }
Tests that the selected population is changed when the index is changed.
Tests that the selected population is changed when the index is changed .