Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs =================================================================== diff -u -r889e8e4ee8267b316e00e8f8a1035c60afb200a0 -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 889e8e4ee8267b316e00e8f8a1035c60afb200a0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/HydraulicBoundaryLocationsView.cs (.../HydraulicBoundaryLocationsView.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -119,7 +119,7 @@ DataGridViewRow currentRow = dataGridViewControl.CurrentRow; if (currentRow == null) { - return null; + return Enumerable.Empty(); } HydraulicBoundaryLocation location = ((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject; @@ -142,7 +142,7 @@ }); } - return null; + return Enumerable.Empty(); } /// Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs =================================================================== diff -u -r2062e1a3a1fd86445625f0b15201ceaf1a516c4c -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision 2062e1a3a1fd86445625f0b15201ceaf1a516c4c) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -161,14 +161,24 @@ { suspendAllEvents = true; dataGridViewControl.RefreshDataGridView(); - illustrationPointsControl.Data = GetIllustrationPointControlItems(); + HandlePossibleOutdatedIllustrationPointsControl(); suspendAllEvents = false; - HandlePossibleOutdatedSelection(); + HandlePossibleOutdatedIllustrationPointsSelection(); } - private void HandlePossibleOutdatedSelection() + private void HandlePossibleOutdatedIllustrationPointsControl() { + IEnumerable illustrationPointControlItems = GetIllustrationPointControlItems().ToArray(); + + if (illustrationPointsControl.Data.Count() != illustrationPointControlItems.Count()) + { + illustrationPointsControl.Data = illustrationPointControlItems; + } + } + + private void HandlePossibleOutdatedIllustrationPointsSelection() + { if (illustrationPointsControl.Selection == null && Selection is SelectedTopLevelSubMechanismIllustrationPoint) { ProvideLocationSelection(); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -132,7 +132,7 @@ } [Test] - public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup var assessmentSection = mockRepository.Stub(); @@ -146,11 +146,11 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(0, 1)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] - public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup var assessmentSection = mockRepository.Stub(); @@ -164,7 +164,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(1, 0)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] @@ -528,7 +528,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(3, 0)); // Precondition - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); var topLevelIllustrationPoints = new[] { Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsViewTest.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -132,7 +132,7 @@ } [Test] - public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup var assessmentSection = mockRepository.Stub(); @@ -146,11 +146,11 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(0, 1)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] - public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup var assessmentSection = mockRepository.Stub(); @@ -164,7 +164,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(1, 0)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] @@ -527,9 +527,8 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(3, 0)); // Precondition - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); - var topLevelIllustrationPoints = new[] { new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection(), Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -112,7 +112,7 @@ } [Test] - public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup ShowFullyConfiguredDesignWaterLevelLocationsView(); @@ -123,11 +123,11 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(0, 1)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] - public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup ShowFullyConfiguredDesignWaterLevelLocationsView(); @@ -138,7 +138,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(1, 0)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] @@ -402,7 +402,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(3, 0)); // Precondition - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); var topLevelIllustrationPoints = new[] { Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 6ef4dd653a4a5922e1d7e06e38fbdd4b9971644c) @@ -110,7 +110,7 @@ } [Test] - public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutOutput_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup ShowFullyConfiguredWaveHeightLocationsView(); @@ -123,11 +123,11 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(0, 1)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] - public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToNull() + public void Selection_LocationWithoutGeneralResult_IllustrationPointsControlDataSetToEmptyEnumeration() { // Setup ShowFullyConfiguredWaveHeightLocationsView(); @@ -140,7 +140,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(1, 0)); // Assert - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); } [Test] @@ -399,7 +399,7 @@ dataGridView.SetCurrentCell(dataGridView.GetCell(3, 0)); // Precondition - Assert.IsNull(illustrationPointsControl.Data); + CollectionAssert.IsEmpty(illustrationPointsControl.Data); var topLevelIllustrationPoints = new[] {