src/GenFx.Wpf.Tests/PopulationViewerTest.cs
/// <summary>
/// Tests that the entities are updated when the population is set to null.
/// </summary>
Tests that the entities are updated when the population is set to null.
Tests that the entities are updated when the population is set to null .
[StaFact]
        public void PopulationViewer_OnSelectedPopulationChanged_NullPopulation()
        {
            PopulationViewer viewer = new PopulationViewer
            {
                ExecutionState = ExecutionState.Idle,
                Population = new TestPopulation()
            };
            TestPopulation population = new TestPopulation();
            population.Entities.Add(Mock.Of<GeneticEntity>());
            population.Entities.Add(Mock.Of<GeneticEntity>());
            viewer.Population = population;
            Assert.Equal(population.Entities, viewer.SelectedPopulationEntities.ToList());
            viewer.Population = null;
            Assert.Null(viewer.SelectedPopulationEntities);
        }
[ StaFact ] public void PopulationViewer_OnSelectedPopulationChanged_NullPopulation ( ) { PopulationViewer viewer = new PopulationViewer { ExecutionState = ExecutionState . Idle , Population = new TestPopulation ( ) } ; TestPopulation population = new TestPopulation ( ) ; population . Entities . Add ( Mock . Of < GeneticEntity > ( ) ) ; population . Entities . Add ( Mock . Of < GeneticEntity > ( ) ) ; viewer . Population = population ; Assert . Equal ( population . Entities , viewer . SelectedPopulationEntities . ToList ( ) ) ; viewer . Population = null ; Assert . Null ( viewer . SelectedPopulationEntities ) ; }
Tests that the entities are updated when the population is set to null.
Tests that the entities are updated when the population is set to null .