Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs
===================================================================
diff -u -rf376e95ad2333bf216fafd39e1568f6cb9782158 -r7172df944db7fd2d59d68a7a8def96110a44ed9b
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision f376e95ad2333bf216fafd39e1568f6cb9782158)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsViewTest.cs) (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -283,10 +283,14 @@
locations.ForEach(loc => loc.DesignWaterLevelOutput = null);
+ int refreshed = 0;
+ dataGridView.Invalidated += (sender, args) => refreshed++;
+
// Call
locations.NotifyObservers();
// Assert
+ Assert.AreEqual(1, refreshed);
Assert.AreEqual(3, rows.Count);
Assert.AreEqual("-", rows[0].Cells[locationDesignWaterlevelColumnIndex].FormattedValue);
Assert.AreEqual("-", rows[1].Cells[locationDesignWaterlevelColumnIndex].FormattedValue);
Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/DataUpdateHelper.cs (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -0,0 +1,64 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.IO;
+using Core.Common.Base.Service;
+using Core.Common.Utils.IO;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Integration.Data;
+using Ringtoets.Piping.Data;
+using Ringtoets.Piping.IO.Importers;
+using Ringtoets.Piping.Plugin.FileImporter;
+
+namespace Ringtoets.Integration.TestUtils
+{
+ ///
+ /// Helper methods related to importing data for integration tests.
+ ///
+ public static class DataUpdateHelper
+ {
+ ///
+ /// Imports the data for the
+ /// of the given and updates existing data based upon the imported
+ /// data.
+ ///
+ /// The to import on.
+ /// When data from is used,
+ /// this will remove 1 soil models, 1 stochastic soil profile and update the probability of another
+ /// stochastic soil profile.
+ public static void UpdatePipingStochasticSoilModels(AssessmentSection assessmentSection)
+ {
+ using (var embeddedResourceFileWriter = new EmbeddedResourceFileWriter(typeof(DataUpdateHelper).Assembly,
+ true,
+ "DR6_updated.soil"))
+ {
+ string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "DR6_updated.soil");
+ var activity = new FileImportActivity(new StochasticSoilModelImporter(
+ assessmentSection.PipingFailureMechanism.StochasticSoilModels,
+ filePath,
+ new StochasticSoilModelUpdateDataStrategy(assessmentSection.PipingFailureMechanism)),
+ "StochasticSoilModelUpdater");
+ activity.Run();
+ activity.Finish();
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/EmbeddedResources/DR6_updated.soil
===================================================================
diff -u
Binary files differ
Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj
===================================================================
diff -u -rf35a1bdec32700c5cb0027d714c8a51dfc118e0d -r7172df944db7fd2d59d68a7a8def96110a44ed9b
--- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj (.../Ringtoets.Integration.TestUtils.csproj) (revision f35a1bdec32700c5cb0027d714c8a51dfc118e0d)
+++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj (.../Ringtoets.Integration.TestUtils.csproj) (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -52,6 +52,7 @@
Properties\GlobalAssembly.cs
+
@@ -80,6 +81,7 @@
+
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs
===================================================================
diff -u -rfde9fb747c4afe9b3c32a80e1efeef24b535decd -r7172df944db7fd2d59d68a7a8def96110a44ed9b
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision fde9fb747c4afe9b3c32a80e1efeef24b535decd)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -47,6 +47,7 @@
private RingtoetsPipingSurfaceLine surfaceLine;
private RoundedDouble assessmentLevel;
private bool useAssessmentLevelManualInput;
+ private StochasticSoilProfile stochasticSoilProfile;
///
/// Initializes a new instance of the class.
@@ -183,7 +184,17 @@
///
/// Gets or sets the profile which contains a 1 dimensional definition of soil layers with properties.
///
- public StochasticSoilProfile StochasticSoilProfile { get; set; }
+ public StochasticSoilProfile StochasticSoilProfile
+ {
+ get
+ {
+ return stochasticSoilProfile;
+ }
+ set
+ {
+ stochasticSoilProfile = value;
+ }
+ }
///
/// Gets or sets the hydraulic boundary location from which to use the assessment level.
Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs
===================================================================
diff -u -r29acdef1f06e3be94d7fd8a94731e391b5d97ae8 -r7172df944db7fd2d59d68a7a8def96110a44ed9b
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 29acdef1f06e3be94d7fd8a94731e391b5d97ae8)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -31,7 +31,7 @@
///
/// This class couples a SoilProfile to a probability of occurrence.
///
- public class StochasticSoilProfile
+ public class StochasticSoilProfile : Observable
{
private double probability;
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs
===================================================================
diff -u -r37fc59cc0f3becb92e14b8263bd8e9fc71aa0e79 -r7172df944db7fd2d59d68a7a8def96110a44ed9b
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision 37fc59cc0f3becb92e14b8263bd8e9fc71aa0e79)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingCalculationsView.cs (.../PipingCalculationsView.cs) (revision 7172df944db7fd2d59d68a7a8def96110a44ed9b)
@@ -58,6 +58,7 @@
private readonly RecursiveObserver pipingCalculationObserver;
private readonly Observer pipingFailureMechanismObserver;
private readonly Observer pipingStochasticSoilModelsObserver;
+ private readonly RecursiveObserver stochasticSoilProfileObserver;
private IAssessmentSection assessmentSection;
private CalculationGroup calculationGroup;
private PipingFailureMechanism pipingFailureMechanism;
@@ -75,13 +76,15 @@
InitializeDataGridView();
InitializeListBox();
- pipingStochasticSoilModelsObserver = new Observer(OnStochasticSoilModelsUpdate);
pipingFailureMechanismObserver = new Observer(OnPipingFailureMechanismUpdate);
assessmentSectionObserver = new Observer(UpdateSelectableHydraulicBoundaryLocationsColumn);
// The concat is needed to observe the input of calculations in child groups.
pipingInputObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children.Concat