Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs =================================================================== diff -u -rab1121dee05c5484181bb1b0470d49eb48d325fe -r8b37c0f11e7d78b71c298763124973e94845c87b --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision ab1121dee05c5484181bb1b0470d49eb48d325fe) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/Piping/PipingCalculationScenarioCreateExtensionsTest.cs (.../PipingCalculationScenarioCreateExtensionsTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -245,7 +245,7 @@ // Setup var registry = new PersistenceRegistry(); - var newOutput = new TestPipingOutput(); + PipingOutput newOutput = PipingOutputTestFactory.Create(); var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { Output = newOutput Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -r339e1d134a2208f180b9f369d275cb98f9736a7c -r8b37c0f11e7d78b71c298763124973e94845c87b --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 339e1d134a2208f180b9f369d275cb98f9736a7c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -997,7 +997,7 @@ StandardDeviation = (RoundedDouble) 4.4 } }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }, new PipingCalculationScenario(pipingFailureMechanism.GeneralInput) { @@ -1029,7 +1029,7 @@ UseAssessmentLevelManualInput = true, AssessmentLevel = (RoundedDouble) 6.0 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() } } }); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesIntegrationTest.cs =================================================================== diff -u -r26d6bbe7a5d0881fcdfd7723f7d9d0bfb8a0c742 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesIntegrationTest.cs (.../FailureMechanismContributionPropertiesIntegrationTest.cs) (revision 26d6bbe7a5d0881fcdfd7723f7d9d0bfb8a0c742) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/FailureMechanismContributionPropertiesIntegrationTest.cs (.../FailureMechanismContributionPropertiesIntegrationTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -76,7 +76,7 @@ var emptyPipingCalculation = new PipingCalculation(new GeneralPipingInput()); var pipingCalculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var emptyGrassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation @@ -223,7 +223,7 @@ var emptyPipingCalculation = new PipingCalculation(new GeneralPipingInput()); var pipingCalculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var emptyGrassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation @@ -408,7 +408,7 @@ var emptyPipingCalculation = new PipingCalculation(new GeneralPipingInput()); var pipingCalculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var emptyGrassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation @@ -498,7 +498,7 @@ var emptyPipingCalculation = new PipingCalculation(new GeneralPipingInput()); var pipingCalculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var emptyGrassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs =================================================================== diff -u -r89eae73f8976ca604e84498de97ed59d5ae1c4bf -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision 89eae73f8976ca604e84498de97ed59d5ae1c4bf) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -465,7 +465,7 @@ var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); - var pipingOutput = new TestPipingOutput(); + PipingOutput pipingOutput = PipingOutputTestFactory.Create(); var pipingCalculation = new PipingCalculation(new GeneralPipingInput()) { InputParameters = Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenarioRow.cs =================================================================== diff -u -r8ab72c61cfda487718df57b1e2a441394804f529 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenarioRow.cs (.../PipingScenarioRow.cs) (revision 8ab72c61cfda487718df57b1e2a441394804f529) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenarioRow.cs (.../PipingScenarioRow.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -35,7 +35,9 @@ /// internal class PipingScenarioRow { - private readonly DerivedPipingOutput derivedOutput; + private readonly PipingFailureMechanism failureMechanism; + private readonly IAssessmentSection assessmentSection; + private DerivedPipingOutput derivedOutput; /// /// Creates a new instance of . @@ -63,11 +65,10 @@ } Calculation = calculation; + this.failureMechanism = failureMechanism; + this.assessmentSection = assessmentSection; - if (calculation.HasOutput) - { - derivedOutput = DerivedPipingOutputFactory.Create(calculation.Output, failureMechanism, assessmentSection); - } + CreateDerivedOutput(); } /// @@ -173,5 +174,17 @@ : ProbabilityFormattingHelper.Format(derivedOutput.SellmeijerProbability); } } + + public void Update() + { + CreateDerivedOutput(); + } + + private void CreateDerivedOutput() + { + derivedOutput = Calculation.HasOutput + ? DerivedPipingOutputFactory.Create(Calculation.Output, failureMechanism, assessmentSection) + : null; + } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs =================================================================== diff -u -r171eda478707e1f059c568074c7be10ecc93abb8 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs (.../PipingScenariosView.cs) (revision 171eda478707e1f059c568074c7be10ecc93abb8) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingScenariosView.cs (.../PipingScenariosView.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -26,6 +26,7 @@ using Core.Common.Base; using Core.Common.Base.Geometry; using Core.Common.Controls.Views; +using Core.Common.Util.Extensions; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; @@ -46,6 +47,7 @@ private readonly Observer pipingFailureMechanismObserver; private CalculationGroup calculationGroup; private PipingFailureMechanism pipingFailureMechanism; + private List pipingScenarioRows; /// /// Creates a new instance of the class. @@ -71,7 +73,7 @@ // The concat is needed to observe the input of calculations in child groups. pipingInputObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children.Concat(pcg.Children.OfType().Select(pc => pc.InputParameters))); pipingCalculationGroupObserver = new RecursiveObserver(UpdateDataGridViewDataSource, pcg => pcg.Children); - pipingCalculationObserver = new RecursiveObserver(dataGridViewControl.RefreshDataGridView, pcg => pcg.Children); + pipingCalculationObserver = new RecursiveObserver(UpdateCalculations, pcg => pcg.Children); } /// @@ -183,14 +185,20 @@ IEnumerable lineSegments = Math2D.ConvertLinePointsToLineSegments(failureMechanismSection.Points); IEnumerable pipingCalculations = calculationGroup - .GetCalculations() - .OfType() - .Where(pc => pc.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments)); + .GetCalculations() + .OfType() + .Where(pc => pc.IsSurfaceLineIntersectionWithReferenceLineInSection(lineSegments)); - List dataSource = pipingCalculations.Select(pc => new PipingScenarioRow(pc, pipingFailureMechanism, assessmentSection)).ToList(); - dataGridViewControl.SetDataSource(dataSource); + pipingScenarioRows = pipingCalculations.Select(pc => new PipingScenarioRow(pc, pipingFailureMechanism, assessmentSection)).ToList(); + dataGridViewControl.SetDataSource(pipingScenarioRows); } + private void UpdateCalculations() + { + pipingScenarioRows.ForEachElementDo(row => row.Update()); + dataGridViewControl.RefreshDataGridView(); + } + #region Event handling private void ListBoxOnSelectedValueChanged(object sender, EventArgs e) Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs =================================================================== diff -u -r77b27109212e94d58eb47248d4210f7eac243fb6 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs (.../PipingCalculationScenarioTest.cs) (revision 77b27109212e94d58eb47248d4210f7eac243fb6) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationScenarioTest.cs (.../PipingCalculationScenarioTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -100,7 +100,7 @@ // Setup var scenario = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs =================================================================== diff -u -r42fe292c690bdcccae5c67a15c1bd5ae290627b7 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs (.../PipingCalculationTest.cs) (revision 42fe292c690bdcccae5c67a15c1bd5ae290627b7) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingCalculationTest.cs (.../PipingCalculationTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -69,7 +69,7 @@ // Setup var calculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; // Call @@ -101,7 +101,7 @@ // Setup var calculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSection2aAssessmentResultExtensionsTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSection2aAssessmentResultExtensionsTest.cs (.../PipingFailureMechanismSection2aAssessmentResultExtensionsTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSection2aAssessmentResultExtensionsTest.cs (.../PipingFailureMechanismSection2aAssessmentResultExtensionsTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -151,7 +151,7 @@ double assessmentLayerTwoA = failureMechanismSectionResult.GetAssessmentLayerTwoA(calculations, failureMechanism, assessmentSection); // Assert - Assert.AreEqual(1.0231368235852602e-10, assessmentLayerTwoA); + Assert.AreEqual(0.028693041013187315, assessmentLayerTwoA); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingOutputTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingOutputTestFactoryTest.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingOutputTestFactoryTest.cs (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2017. 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; +using NUnit.Framework; + +namespace Ringtoets.Piping.Data.TestUtil.Test +{ + [TestFixture] + public class PipingOutputTestFactoryTest + { + [Test] + public void Create_WithoutParameters_ReturnOutput() + { + // Call + PipingOutput output = PipingOutputTestFactory.Create(); + + // Assert + Assert.IsTrue(IsValidDouble(output.HeaveZValue)); + Assert.IsTrue(IsValidDouble(output.HeaveFactorOfSafety)); + Assert.IsTrue(IsValidDouble(output.UpliftEffectiveStress)); + Assert.IsTrue(IsValidDouble(output.UpliftZValue)); + Assert.IsTrue(IsValidDouble(output.UpliftFactorOfSafety)); + Assert.IsTrue(IsValidDouble(output.SellmeijerZValue)); + Assert.IsTrue(IsValidDouble(output.SellmeijerFactorOfSafety)); + Assert.IsTrue(IsValidDouble(output.HeaveGradient)); + Assert.IsTrue(IsValidDouble(output.SellmeijerCreepCoefficient)); + Assert.IsTrue(IsValidDouble(output.SellmeijerCriticalFall)); + Assert.IsTrue(IsValidDouble(output.SellmeijerReducedFall)); + } + + [Test] + public void Create_WithParameters_ReturnOutput() + { + // Setup + var random = new Random(39); + double heaveFactorOfSafety = random.NextDouble(); + double upliftFactorOfSafety = random.NextDouble(); + double sellmeijerFactorOfSafety = random.NextDouble(); + + // Call + PipingOutput output = PipingOutputTestFactory.Create(heaveFactorOfSafety, upliftFactorOfSafety, sellmeijerFactorOfSafety); + + // Assert + Assert.AreEqual(heaveFactorOfSafety, output.HeaveFactorOfSafety); + Assert.AreEqual(upliftFactorOfSafety, output.UpliftFactorOfSafety); + Assert.AreEqual(sellmeijerFactorOfSafety, output.SellmeijerFactorOfSafety); + } + + private static bool IsValidDouble(double value) + { + return !double.IsNaN(value) && !double.IsInfinity(value); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/Ringtoets.Piping.Data.TestUtil.Test.csproj =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/Ringtoets.Piping.Data.TestUtil.Test.csproj (.../Ringtoets.Piping.Data.TestUtil.Test.csproj) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/Ringtoets.Piping.Data.TestUtil.Test.csproj (.../Ringtoets.Piping.Data.TestUtil.Test.csproj) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -17,6 +17,7 @@ + Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationScenarioTestFactory.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationScenarioTestFactory.cs (.../PipingCalculationScenarioTestFactory.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingCalculationScenarioTestFactory.cs (.../PipingCalculationScenarioTestFactory.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -47,7 +47,7 @@ public static PipingCalculationScenario CreatePipingCalculationScenario(FailureMechanismSection section) { PipingCalculationScenario scenario = CreateNotCalculatedPipingCalculationScenario(section); - scenario.Output = new TestPipingOutput(); + scenario.Output = PipingOutputTestFactory.Create(); return scenario; } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingOutputTestFactory.cs =================================================================== diff -u --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingOutputTestFactory.cs (revision 0) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingOutputTestFactory.cs (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -0,0 +1,73 @@ +// Copyright (C) Stichting Deltares 2017. 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; + +namespace Ringtoets.Piping.Data.TestUtil +{ + /// + /// Factory for creating that can be used + /// for test purposes. + /// + public static class PipingOutputTestFactory + { + /// + /// Creates with random values. + /// + /// The created . + public static PipingOutput Create() + { + var random = new Random(39); + + return new PipingOutput(new PipingOutput.ConstructionProperties + { + HeaveZValue = random.NextDouble(), + HeaveFactorOfSafety = random.NextDouble(), + UpliftEffectiveStress = random.NextDouble(), + UpliftZValue = random.NextDouble(), + UpliftFactorOfSafety = random.NextDouble(), + SellmeijerZValue = random.NextDouble(), + SellmeijerFactorOfSafety = random.NextDouble(), + HeaveGradient = random.NextDouble(), + SellmeijerCreepCoefficient = random.NextDouble(), + SellmeijerCriticalFall = random.NextDouble(), + SellmeijerReducedFall = random.NextDouble() + }); + } + + /// + /// Creates output with the given values. + /// + /// The heave factor of safety. + /// The uplift factor of safety. + /// The sellmeijer factor of safety. + /// The created . + public static PipingOutput Create(double heaveFactorOfSafety, double upliftFactorOfSafety, double sellmeijerFactorOfSafety) + { + return new PipingOutput(new PipingOutput.ConstructionProperties + { + HeaveFactorOfSafety = heaveFactorOfSafety, + UpliftFactorOfSafety = upliftFactorOfSafety, + SellmeijerFactorOfSafety = sellmeijerFactorOfSafety + }); + } + } +} \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingTestDataGenerator.cs =================================================================== diff -u -rab1121dee05c5484181bb1b0470d49eb48d325fe -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingTestDataGenerator.cs (.../PipingTestDataGenerator.cs) (revision ab1121dee05c5484181bb1b0470d49eb48d325fe) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingTestDataGenerator.cs (.../PipingTestDataGenerator.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -302,7 +302,7 @@ SurfaceLine = surfaceLine1, StochasticSoilModel = stochasticSoilModel1 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var calculationWithSurfaceLineAndSoilModel = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -322,7 +322,7 @@ SurfaceLine = surfaceLine2, StochasticSoilModel = stochasticSoilModel2 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var calculationWithHydraulicBoundaryLocation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -351,7 +351,7 @@ StochasticSoilModel = stochasticSoilModel2, StochasticSoilProfile = stochasticSoilModel2.StochasticSoilProfiles.First() }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var subCalculationWithOutputAndHydraulicBoundaryLocation = new PipingCalculationScenario(new GeneralPipingInput()) { @@ -362,7 +362,7 @@ StochasticSoilModel = stochasticSoilModel1, StochasticSoilProfile = stochasticSoilModel1.StochasticSoilProfiles.First() }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var subCalculationWithHydraulicBoundaryLocation = new PipingCalculationScenario(new GeneralPipingInput()) { Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj (.../Ringtoets.Piping.Data.TestUtil.csproj) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/Ringtoets.Piping.Data.TestUtil.csproj (.../Ringtoets.Piping.Data.TestUtil.csproj) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -18,13 +18,13 @@ + - Fisheye: Tag 8b37c0f11e7d78b71c298763124973e94845c87b refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/TestPipingOutput.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs (.../PipingOutputContextTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingOutputContextTest.cs (.../PipingOutputContextTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -59,7 +59,7 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new PipingOutputContext(new TestPipingOutput(), null, assessmentSection); + TestDelegate test = () => new PipingOutputContext(PipingOutputTestFactory.Create(), null, assessmentSection); // Assert string paramName = Assert.Throws(test).ParamName; @@ -71,7 +71,7 @@ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new PipingOutputContext(new TestPipingOutput(), new PipingFailureMechanism(), null); + TestDelegate call = () => new PipingOutputContext(PipingOutputTestFactory.Create(), new PipingFailureMechanism(), null); // Assert var exception = Assert.Throws(call); @@ -86,7 +86,7 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var output = new TestPipingOutput(); + PipingOutput output = PipingOutputTestFactory.Create(); var failureMechanism = new PipingFailureMechanism(); // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputPropertiesTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputPropertiesTest.cs (.../PipingOutputPropertiesTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingOutputPropertiesTest.cs (.../PipingOutputPropertiesTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -62,7 +62,7 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new PipingOutputProperties(new TestPipingOutput(), null, assessmentSection); + TestDelegate test = () => new PipingOutputProperties(PipingOutputTestFactory.Create(), null, assessmentSection); // Assert string paramName = Assert.Throws(test).ParamName; @@ -74,7 +74,7 @@ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new PipingOutputProperties(new TestPipingOutput(), new PipingFailureMechanism(), null); + TestDelegate call = () => new PipingOutputProperties(PipingOutputTestFactory.Create(), new PipingFailureMechanism(), null); // Assert var exception = Assert.Throws(call); @@ -91,7 +91,7 @@ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); mocks.ReplayAll(); - var output = new TestPipingOutput(); + PipingOutput output = PipingOutputTestFactory.Create(); // Call var properties = new PipingOutputProperties(output, failureMechanism, assessmentSection); @@ -174,7 +174,7 @@ mocks.ReplayAll(); // Call - var properties = new PipingOutputProperties(new TestPipingOutput(), failureMechanism, assessmentSection); + var properties = new PipingOutputProperties(PipingOutputTestFactory.Create(), failureMechanism, assessmentSection); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationRowTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationRowTest.cs (.../PipingCalculationRowTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationRowTest.cs (.../PipingCalculationRowTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -472,12 +472,12 @@ var handler = mockRepository.Stub(); mockRepository.ReplayAll(); - TestPipingOutput assignedOutput = null; + PipingOutput assignedOutput = null; PipingCalculationScenario calculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); if (hasOutput) { - assignedOutput = new TestPipingOutput(); + assignedOutput = PipingOutputTestFactory.Create(); } calculation.Output = assignedOutput; Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs =================================================================== diff -u -r715999e4f5efc2e78494f1b38532975ac02bcd77 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision 715999e4f5efc2e78494f1b38532975ac02bcd77) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -1085,7 +1085,7 @@ if (useCalculationWithOutput) { - pipingCalculation.Output = new TestPipingOutput(); + pipingCalculation.Output = PipingOutputTestFactory.Create(); } pipingCalculation.Attach(pipingCalculationObserver); @@ -1158,7 +1158,7 @@ if (useCalculationWithOutput) { - pipingCalculation.Output = new TestPipingOutput(); + pipingCalculation.Output = PipingOutputTestFactory.Create(); } pipingCalculation.Attach(pipingCalculationObserver); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs (.../PipingFailureMechanismResultViewTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs (.../PipingFailureMechanismResultViewTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -371,7 +371,7 @@ // Assert Assert.IsEmpty(dataGridViewCell.ErrorText); - Assert.AreEqual("1/980.908.719.666.769.000.000", + Assert.AreEqual("1/4.123", formattedValue); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenarioRowTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenarioRowTest.cs (.../PipingScenarioRowTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenarioRowTest.cs (.../PipingScenarioRowTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -97,7 +97,7 @@ mocks.ReplayAll(); PipingCalculationScenario calculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); - calculation.Output = new TestPipingOutput(); + calculation.Output = PipingOutputTestFactory.Create(); // Call var row = new PipingScenarioRow(calculation, failureMechanism, assessmentSection); @@ -191,5 +191,113 @@ Assert.AreEqual(new RoundedDouble(2, newValue), calculation.Contribution * 100); mocks.VerifyAll(); } - } + + [Test] + public void GivenScenarioRow_WhenOutputSetAndUpdate_ThenDerivedOutputUpdated() + { + // Given + var failureMechanism = new PipingFailureMechanism(); + + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + mocks.ReplayAll(); + + PipingCalculationScenario calculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); + + var row = new PipingScenarioRow(calculation, failureMechanism, assessmentSection); + + // Precondition + Assert.AreEqual("-", row.FailureProbabilityPiping); + Assert.AreEqual("-", row.FailureProbabilityUplift); + Assert.AreEqual("-", row.FailureProbabilityHeave); + Assert.AreEqual("-", row.FailureProbabilitySellmeijer); + + // When + calculation.Output = PipingOutputTestFactory.Create(); + row.Update(); + + // Then + DerivedPipingOutput expectedDerivedOutput = DerivedPipingOutputFactory.Create( + calculation.Output, failureMechanism, assessmentSection); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.PipingProbability), row.FailureProbabilityPiping); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.UpliftProbability), row.FailureProbabilityUplift); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.HeaveProbability), row.FailureProbabilityHeave); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.SellmeijerProbability), row.FailureProbabilitySellmeijer); + mocks.VerifyAll(); + } + + [Test] + public void GivenScenarioRow_WhenOutputSetToNullAndUpdate_ThenDerivedOutputUpdated() + { + // Given + var failureMechanism = new PipingFailureMechanism(); + + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + mocks.ReplayAll(); + + PipingCalculationScenario calculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); + calculation.Output = PipingOutputTestFactory.Create(); + + var row = new PipingScenarioRow(calculation, failureMechanism, assessmentSection); + + // Precondition + DerivedPipingOutput expectedDerivedOutput = DerivedPipingOutputFactory.Create( + calculation.Output, failureMechanism, assessmentSection); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.PipingProbability), row.FailureProbabilityPiping); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.UpliftProbability), row.FailureProbabilityUplift); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.HeaveProbability), row.FailureProbabilityHeave); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.SellmeijerProbability), row.FailureProbabilitySellmeijer); + + // When + calculation.Output = null; + row.Update(); + + // Then + Assert.AreEqual("-", row.FailureProbabilityPiping); + Assert.AreEqual("-", row.FailureProbabilityUplift); + Assert.AreEqual("-", row.FailureProbabilityHeave); + Assert.AreEqual("-", row.FailureProbabilitySellmeijer); + mocks.VerifyAll(); + } + + [Test] + public void GivenScenarioRow_WhenOutputChangedAndUpdate_ThenDerivedOutputUpdated() + { + // Given + var failureMechanism = new PipingFailureMechanism(); + + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + mocks.ReplayAll(); + + PipingCalculationScenario calculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); + calculation.Output = PipingOutputTestFactory.Create(); + + var row = new PipingScenarioRow(calculation, failureMechanism, assessmentSection); + + // Precondition + DerivedPipingOutput expectedDerivedOutput = DerivedPipingOutputFactory.Create( + calculation.Output, failureMechanism, assessmentSection); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.PipingProbability), row.FailureProbabilityPiping); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.UpliftProbability), row.FailureProbabilityUplift); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.HeaveProbability), row.FailureProbabilityHeave); + Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedDerivedOutput.SellmeijerProbability), row.FailureProbabilitySellmeijer); + + var random = new Random(11); + + // When + calculation.Output = PipingOutputTestFactory.Create(random.NextDouble(), random.NextDouble(), random.NextDouble()); + row.Update(); + + // Then + DerivedPipingOutput newExpectedDerivedOutput = DerivedPipingOutputFactory.Create( + calculation.Output, failureMechanism, assessmentSection); + Assert.AreEqual(ProbabilityFormattingHelper.Format(newExpectedDerivedOutput.PipingProbability), row.FailureProbabilityPiping); + Assert.AreEqual(ProbabilityFormattingHelper.Format(newExpectedDerivedOutput.UpliftProbability), row.FailureProbabilityUplift); + Assert.AreEqual(ProbabilityFormattingHelper.Format(newExpectedDerivedOutput.HeaveProbability), row.FailureProbabilityHeave); + Assert.AreEqual(ProbabilityFormattingHelper.Format(newExpectedDerivedOutput.SellmeijerProbability), row.FailureProbabilitySellmeijer); + mocks.VerifyAll(); + } + } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenariosViewTest.cs =================================================================== diff -u -rb0ab8bebd62aad140b166271c7519f182c933648 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenariosViewTest.cs (.../PipingScenariosViewTest.cs) (revision b0ab8bebd62aad140b166271c7519f182c933648) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingScenariosViewTest.cs (.../PipingScenariosViewTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -239,10 +239,10 @@ Assert.IsTrue(Convert.ToBoolean(cells[isRelevantColumnIndex].FormattedValue)); Assert.AreEqual(100.ToString(CultureInfo.CurrentCulture), cells[contributionColumnIndex].FormattedValue); Assert.AreEqual("Calculation 2", cells[nameColumnIndex].FormattedValue); - Assert.AreEqual("1/980.908.719.666.769.000.000", cells[failureProbabilityPipingColumnIndex].FormattedValue); - Assert.AreEqual("1/204.463.909.053", cells[failureProbabilityUpliftColumnIndex].FormattedValue); - Assert.AreEqual("1/31.469.301", cells[failureProbabilityHeaveColumnIndex].FormattedValue); - Assert.AreEqual("1/980.908.719.666.769.000.000", cells[failureProbabilitySellmeijerColumnIndex].FormattedValue); + Assert.AreEqual("1/4.123", cells[failureProbabilityPipingColumnIndex].FormattedValue); + Assert.AreEqual("1/4.123", cells[failureProbabilityUpliftColumnIndex].FormattedValue); + Assert.AreEqual("1/26", cells[failureProbabilityHeaveColumnIndex].FormattedValue); + Assert.AreEqual("1/36", cells[failureProbabilitySellmeijerColumnIndex].FormattedValue); } [Test] @@ -336,6 +336,46 @@ } } + [Test] + [SetCulture("nl-NL")] + public void GivenPipingScenarioView_WhenCalculationNotifiesObserver_ThenViewUpdated() + { + // Given + using (ShowFullyConfiguredPipingScenarioView()) + { + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + int refreshed = 0; + dataGridView.Invalidated += (sender, args) => refreshed++; + + DataGridViewRowCollection rows = dataGridView.Rows; + Assert.AreEqual(2, rows.Count); + + DataGridViewRow calculationRow = rows[1]; + PipingCalculationScenario calculation = ((PipingScenarioRow) calculationRow.DataBoundItem).Calculation; + + // Precondition + DataGridViewCellCollection cells = calculationRow.Cells; + Assert.AreEqual(7, cells.Count); + Assert.AreEqual("1/4.123", cells[failureProbabilityPipingColumnIndex].FormattedValue); + Assert.AreEqual("1/4.123", cells[failureProbabilityUpliftColumnIndex].FormattedValue); + Assert.AreEqual("1/26", cells[failureProbabilityHeaveColumnIndex].FormattedValue); + Assert.AreEqual("1/36", cells[failureProbabilitySellmeijerColumnIndex].FormattedValue); + + // When + calculation.ClearOutput(); + calculation.NotifyObservers(); + + // Then + Assert.AreEqual(1, refreshed); + + Assert.AreEqual("-", cells[failureProbabilityPipingColumnIndex].FormattedValue); + Assert.AreEqual("-".ToString(CultureInfo.CurrentCulture), cells[failureProbabilityUpliftColumnIndex].FormattedValue); + Assert.AreEqual("-".ToString(CultureInfo.CurrentCulture), cells[failureProbabilityHeaveColumnIndex].FormattedValue); + Assert.AreEqual("-".ToString(CultureInfo.CurrentCulture), cells[failureProbabilitySellmeijerColumnIndex].FormattedValue); + } + } + public override void Setup() { base.Setup(); @@ -431,8 +471,8 @@ EntryPointL = (RoundedDouble) 7.7777, ExitPointL = (RoundedDouble) 8.8888 }, - Output = new TestPipingOutput() - } + Output = PipingOutputTestFactory.Create() + } } }; Index: Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/PipingFailureMechanismResultViewIntegrationTest.cs =================================================================== diff -u -rfb3c4216478c0f072cf2f1a94053e81756ced5c7 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/PipingFailureMechanismResultViewIntegrationTest.cs (.../PipingFailureMechanismResultViewIntegrationTest.cs) (revision fb3c4216478c0f072cf2f1a94053e81756ced5c7) +++ Ringtoets/Piping/test/Ringtoets.Piping.Integration.Test/PipingFailureMechanismResultViewIntegrationTest.cs (.../PipingFailureMechanismResultViewIntegrationTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -121,17 +121,17 @@ dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].ErrorText); // Execute the first calculation and ensure the data grid view is updated - pipingCalculation1.Output = new TestPipingOutput(); + pipingCalculation1.Output = PipingOutputTestFactory.Create(); pipingCalculation1.NotifyObservers(); - Assert.AreEqual("1/980.908.719.666.769.000.000", + Assert.AreEqual("1/4.123", dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].FormattedValue); Assert.IsEmpty(dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].ErrorText); // Add another, nested calculation without surface line and ensure the data grid view is updated when the surface line is set var pipingCalculation3 = new PipingCalculationScenario(new GeneralPipingInput()); nestedPipingCalculationGroup.Children.Add(pipingCalculation3); nestedPipingCalculationGroup.NotifyObservers(); - Assert.AreEqual("1/980.908.719.666.769.000.000", + Assert.AreEqual("1/4.123", dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].FormattedValue); Assert.IsEmpty(dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].ErrorText); @@ -165,7 +165,7 @@ // Set contribution again so we have a probability. pipingCalculation1.Contribution = (RoundedDouble) 1.0; pipingCalculation1.NotifyObservers(); - Assert.AreEqual("1/980.908.719.666.769.000.000", + Assert.AreEqual("1/4.123", dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].FormattedValue); Assert.IsEmpty(dataGridView.Rows[22].Cells[assessmentLayerTwoAIndex].ErrorText); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineUpdateDataStrategyTest.cs =================================================================== diff -u -r53fa30076e4e6576728f01a8dfff7314889ddb3a -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineUpdateDataStrategyTest.cs (.../PipingSurfaceLineUpdateDataStrategyTest.cs) (revision 53fa30076e4e6576728f01a8dfff7314889ddb3a) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/FileImporter/PipingSurfaceLineUpdateDataStrategyTest.cs (.../PipingSurfaceLineUpdateDataStrategyTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -451,7 +451,7 @@ { SurfaceLine = surfaceLine }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); @@ -498,8 +498,8 @@ { SurfaceLine = affectedSurfaceLine }, - Output = new TestPipingOutput() - }; + Output = PipingOutputTestFactory.Create() + }; var unaffectedGeometry = new[] { @@ -514,7 +514,7 @@ { SurfaceLine = unaffectedSurfaceLine }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); @@ -580,7 +580,7 @@ { SurfaceLine = removedSurfaceLine }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var unaffectedGeometry = new[] @@ -596,7 +596,7 @@ { SurfaceLine = unaffectedSurfaceLine }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); @@ -1003,7 +1003,7 @@ { SurfaceLine = affectedSurfaceLine }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); @@ -1057,7 +1057,7 @@ SurfaceLine = affectedSurfaceLine, EntryPointL = (RoundedDouble) 2 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); @@ -1123,7 +1123,7 @@ EntryPointL = (RoundedDouble) 0, ExitPointL = (RoundedDouble) 3 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingStochasticSoilModelCollectionContextImportInfoTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingStochasticSoilModelCollectionContextImportInfoTest.cs (.../PipingStochasticSoilModelCollectionContextImportInfoTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingStochasticSoilModelCollectionContextImportInfoTest.cs (.../PipingStochasticSoilModelCollectionContextImportInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -176,7 +176,7 @@ var failureMechanism = new PipingFailureMechanism(); var calculationWithOutput = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingSurfaceLinesContextImportInfoTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingSurfaceLinesContextImportInfoTest.cs (.../PipingSurfaceLinesContextImportInfoTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ImportInfos/PipingSurfaceLinesContextImportInfoTest.cs (.../PipingSurfaceLinesContextImportInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -178,7 +178,7 @@ var failureMechanism = new PipingFailureMechanism(); var calculationWithOutput = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PropertyInfos/PipingOutputPropertyInfoTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PropertyInfos/PipingOutputPropertyInfoTest.cs (.../PipingOutputPropertyInfoTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PropertyInfos/PipingOutputPropertyInfoTest.cs (.../PipingOutputPropertyInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -69,7 +69,7 @@ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); mocks.ReplayAll(); - var output = new TestPipingOutput(); + PipingOutput output = PipingOutputTestFactory.Create(); var context = new PipingOutputContext(output, failureMechanism, assessmentSection); // Call Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -193,7 +193,7 @@ group.Children.Add(new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }); var pipingFailureMechanism = new TestPipingFailureMechanism(); @@ -326,7 +326,7 @@ group.Children.Add(new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }); var pipingFailureMechanism = new TestPipingFailureMechanism(); @@ -1102,11 +1102,11 @@ PipingCalculationScenario calculation1 = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); calculation1.Name = "A"; - calculation1.Output = new TestPipingOutput(); + calculation1.Output = PipingOutputTestFactory.Create(); calculation1.Attach(calculation1Observer); PipingCalculationScenario calculation2 = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithValidInput(); calculation2.Name = "B"; - calculation2.Output = new TestPipingOutput(); + calculation2.Output = PipingOutputTestFactory.Create(); calculation2.Attach(calculation2Observer); var childGroup = new CalculationGroup(); @@ -1670,7 +1670,7 @@ EntryPointL = (RoundedDouble) 0, ExitPointL = (RoundedDouble) 1 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; calculation1.Attach(calculation1Observer); calculation1.InputParameters.Attach(calculation1InputObserver); @@ -1683,7 +1683,7 @@ EntryPointL = (RoundedDouble) 0, ExitPointL = (RoundedDouble) 1 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; calculation2.Attach(calculation2Observer); calculation2.InputParameters.Attach(calculation2InputObserver); @@ -1785,7 +1785,7 @@ EntryPointL = (RoundedDouble) 0, ExitPointL = (RoundedDouble) 1 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; calculation1.Attach(calculation1Observer); calculation1.InputParameters.Attach(calculation1InputObserver); @@ -1798,7 +1798,7 @@ EntryPointL = (RoundedDouble) 0, ExitPointL = (RoundedDouble) 1 }, - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; calculation2.Attach(calculation2Observer); calculation2.InputParameters.Attach(calculation2InputObserver); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -111,7 +111,7 @@ // Setup var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var pipingFailureMechanism = new PipingFailureMechanism(); @@ -225,7 +225,7 @@ { var calculation = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var pipingFailureMechanism = new TestPipingFailureMechanism(); var assessmentSection = mocks.Stub(); @@ -645,7 +645,7 @@ PipingSurfaceLine surfaceLine; PipingCalculationScenario calculation; CreateCalculationWithSurfaceLine(out calculation, out surfaceLine); - calculation.Output = new TestPipingOutput(); + calculation.Output = PipingOutputTestFactory.Create(); var pipingFailureMechanism = new TestPipingFailureMechanism(); var assessmentSection = mocks.Stub(); @@ -707,7 +707,7 @@ PipingSurfaceLine surfaceLine; PipingCalculationScenario calculation; CreateCalculationWithSurfaceLine(out calculation, out surfaceLine); - calculation.Output = new TestPipingOutput(); + calculation.Output = PipingOutputTestFactory.Create(); var pipingFailureMechanism = new TestPipingFailureMechanism(); var assessmentSection = mocks.Stub(); @@ -1071,7 +1071,7 @@ plugin.Gui = gui; - calculation.Output = new TestPipingOutput(); + calculation.Output = PipingOutputTestFactory.Create(); calculation.Attach(observer); string messageBoxText = null, messageBoxTitle = null; Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -238,11 +238,11 @@ var generalInputParameters = new GeneralPipingInput(); var pipingCalculation1 = new PipingCalculationScenario(generalInputParameters) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var pipingCalculation2 = new PipingCalculationScenario(generalInputParameters) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var observer = mocks.StrictMock(); @@ -313,7 +313,7 @@ var failureMechanism = new TestPipingFailureMechanism(); var pipingCalculation = new PipingCalculationScenario(failureMechanism.GeneralInput) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; failureMechanism.CalculationsGroup.Children.Add(pipingCalculation); @@ -447,7 +447,7 @@ { var pipingCalculation = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; var failureMechanism = new PipingFailureMechanism(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingStochasticSoilModelCollectionContextUpdateInfoTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingStochasticSoilModelCollectionContextUpdateInfoTest.cs (.../PipingStochasticSoilModelCollectionContextUpdateInfoTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingStochasticSoilModelCollectionContextUpdateInfoTest.cs (.../PipingStochasticSoilModelCollectionContextUpdateInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -177,7 +177,7 @@ var failureMechanism = new PipingFailureMechanism(); var calculationWithOutput = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingSurfaceLinesContextUpdateInfoTest.cs =================================================================== diff -u -rb0b8bffcbb871a42e6c8b282fe20858d6a738dbc -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingSurfaceLinesContextUpdateInfoTest.cs (.../PipingSurfaceLinesContextUpdateInfoTest.cs) (revision b0b8bffcbb871a42e6c8b282fe20858d6a738dbc) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/UpdateInfos/PipingSurfaceLinesContextUpdateInfoTest.cs (.../PipingSurfaceLinesContextUpdateInfoTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -176,7 +176,7 @@ var failureMechanism = new PipingFailureMechanism(); var calculationWithOutput = new PipingCalculationScenario(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs (.../PipingCalculationActivityTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationActivityTest.cs (.../PipingCalculationActivityTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -70,7 +70,7 @@ public void Run_InvalidPipingCalculationWithOutput_LogValidationStartAndEndWithErrors() { // Setup - var originalOutput = new TestPipingOutput(); + PipingOutput originalOutput = PipingOutputTestFactory.Create(); PipingCalculationScenario invalidPipingCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithInvalidInput(); invalidPipingCalculation.Output = originalOutput; Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs =================================================================== diff -u -r3bcc8993307e3b6dea8f496d6acbc9c474581787 -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 3bcc8993307e3b6dea8f496d6acbc9c474581787) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -82,7 +82,7 @@ public void Validate_InvalidPipingCalculationWithOutput_ReturnsFalseNoOutputChange() { // Setup - var output = new TestPipingOutput(); + PipingOutput output = PipingOutputTestFactory.Create(); PipingCalculation invalidPipingCalculation = PipingCalculationScenarioTestFactory.CreatePipingCalculationScenarioWithInvalidInput(); invalidPipingCalculation.Output = output; @@ -999,7 +999,7 @@ public void Calculate_ValidPipingCalculationWithOutput_ShouldChangeOutput() { // Setup - var output = new TestPipingOutput(); + PipingOutput output = PipingOutputTestFactory.Create(); RoundedDouble normativeAssessmentLevel = GetTestNormativeAssessmentLevel(); testCalculation.Output = output; Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingDataSynchronizationServiceTest.cs =================================================================== diff -u -r53fa30076e4e6576728f01a8dfff7314889ddb3a -r8b37c0f11e7d78b71c298763124973e94845c87b --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingDataSynchronizationServiceTest.cs (.../PipingDataSynchronizationServiceTest.cs) (revision 53fa30076e4e6576728f01a8dfff7314889ddb3a) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingDataSynchronizationServiceTest.cs (.../PipingDataSynchronizationServiceTest.cs) (revision 8b37c0f11e7d78b71c298763124973e94845c87b) @@ -54,7 +54,7 @@ // Setup var calculation = new PipingCalculation(new GeneralPipingInput()) { - Output = new TestPipingOutput() + Output = PipingOutputTestFactory.Create() }; // Call