Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs =================================================================== diff -u -rb2b9fdf365e70928a05c57966eeed30d9050e528 -r08ae1e1f03d86959cbcec3692983183faaa42b6b --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs (.../PipingChartDataFactory.cs) (revision b2b9fdf365e70928a05c57966eeed30d9050e528) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingChartDataFactory.cs (.../PipingChartDataFactory.cs) (revision 08ae1e1f03d86959cbcec3692983183faaa42b6b) @@ -196,20 +196,20 @@ } /// - /// Updates the name of based on . + /// Updates the name of based on . /// /// The to update the name for. - /// The used for obtaining the name. + /// The used for obtaining the name. /// A default name is set (the same as in ) when: /// - /// is null; - /// the in is null. + /// is null; + /// the in is null. /// /// - public static void UpdateSoilProfileChartDataName(ChartDataCollection chartData, StochasticSoilProfile stochasticSoilProfile) + public static void UpdateSoilProfileChartDataName(ChartDataCollection chartData, PipingSoilProfile soilProfile) { - chartData.Name = stochasticSoilProfile != null && stochasticSoilProfile.SoilProfile != null - ? stochasticSoilProfile.SoilProfile.Name + chartData.Name = soilProfile != null + ? soilProfile.Name : Resources.StochasticSoilProfileProperties_DisplayName; } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs =================================================================== diff -u -r673bf2f4f4de6006444aae3a10183f9442eb0f23 -r08ae1e1f03d86959cbcec3692983183faaa42b6b --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision 673bf2f4f4de6006444aae3a10183f9442eb0f23) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingInputView.cs (.../PipingInputView.cs) (revision 08ae1e1f03d86959cbcec3692983183faaa42b6b) @@ -57,7 +57,7 @@ private PipingCalculationScenario data; - private StochasticSoilProfile currentStochasticSoilProfile; + private PipingSoilProfile currentSoilProfile; /// /// Creates a new instance of . @@ -207,23 +207,23 @@ private void SetSoilProfileChartData() { - var stochasticSoilProfile = data.InputParameters.StochasticSoilProfile; + var soilProfile = data.InputParameters.StochasticSoilProfile?.SoilProfile; // If necessary, regenerate all soil layer chart data - if (!ReferenceEquals(currentStochasticSoilProfile, stochasticSoilProfile)) + if (!ReferenceEquals(currentSoilProfile, soilProfile)) { - currentStochasticSoilProfile = stochasticSoilProfile; + currentSoilProfile = soilProfile; soilProfileChartData.Clear(); soilLayerChartDataLookup.Clear(); - GetSoilLayers().Select((layer, layerIndex) => PipingChartDataFactory.CreateSoilLayerChartData(layerIndex, stochasticSoilProfile.SoilProfile)) + GetSoilLayers().Select((layer, layerIndex) => PipingChartDataFactory.CreateSoilLayerChartData(layerIndex, currentSoilProfile)) .ForEachElementDo(sl => { soilProfileChartData.Insert(0, sl); soilLayerChartDataLookup.Add(sl); }); - PipingChartDataFactory.UpdateSoilProfileChartDataName(soilProfileChartData, stochasticSoilProfile); + PipingChartDataFactory.UpdateSoilProfileChartDataName(soilProfileChartData, currentSoilProfile); } // Update the areas of all soil layer chart data @@ -233,7 +233,7 @@ { var soilLayerData = soilLayerChartDataLookup[i]; - soilLayerData.Areas = PipingChartDataPointsFactory.CreateSoilLayerAreas(soilLayers[i], stochasticSoilProfile.SoilProfile, data.InputParameters.SurfaceLine); + soilLayerData.Areas = PipingChartDataPointsFactory.CreateSoilLayerAreas(soilLayers[i], currentSoilProfile, data.InputParameters.SurfaceLine); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingChartDataFactoryTest.cs =================================================================== diff -u -re42bdf3dd379c46bab9212eb7b30f4754c9bc91c -r08ae1e1f03d86959cbcec3692983183faaa42b6b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingChartDataFactoryTest.cs (.../PipingChartDataFactoryTest.cs) (revision e42bdf3dd379c46bab9212eb7b30f4754c9bc91c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingChartDataFactoryTest.cs (.../PipingChartDataFactoryTest.cs) (revision 08ae1e1f03d86959cbcec3692983183faaa42b6b) @@ -234,7 +234,7 @@ } [Test] - public void UpdateSoilProfileChartDataName_StochasticSoilProfileNull_NameSetToDefaultSoilProfileName() + public void UpdateSoilProfileChartDataName_WithoutSoilProfile_NameSetToDefaultSoilProfileName() { // Setup var chartData = new ChartDataCollection("test name"); @@ -247,36 +247,19 @@ } [Test] - public void UpdateSoilProfileChartDataName_SoilProfileNull_NameSetToDefaultSoilProfileName() + public void UpdateSoilProfileChartDataName_WithSoilProfile_NameSetToSoilProfileName() { // Setup var chartData = new ChartDataCollection("test name"); - var stochasticSoilProfile = new StochasticSoilProfile(0.1, SoilProfileType.SoilProfile1D, 1); + var soilProfile = new PipingSoilProfile("soil profile name", 2.0, new[] + { + new PipingSoilLayer(3.2) + }, SoilProfileType.SoilProfile1D, 0); // Call - PipingChartDataFactory.UpdateSoilProfileChartDataName(chartData, stochasticSoilProfile); + PipingChartDataFactory.UpdateSoilProfileChartDataName(chartData, soilProfile); // Assert - Assert.AreEqual(Resources.StochasticSoilProfileProperties_DisplayName, chartData.Name); - } - - [Test] - public void UpdateSoilProfileChartDataName_StochasticSoilProfileWithSoilProfile_NameSetToSoilProfileName() - { - // Setup - var chartData = new ChartDataCollection("test name"); - var stochasticSoilProfile = new StochasticSoilProfile(0.1, SoilProfileType.SoilProfile1D, 1) - { - SoilProfile = new PipingSoilProfile("soil profile name", 2.0, new[] - { - new PipingSoilLayer(3.2) - }, SoilProfileType.SoilProfile1D, 0) - }; - - // Call - PipingChartDataFactory.UpdateSoilProfileChartDataName(chartData, stochasticSoilProfile); - - // Assert Assert.AreEqual("soil profile name", chartData.Name); }