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