Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/AssessmentSectionCompositionChangeHandlerTest.cs =================================================================== diff -u -rcf55284bcecdef7b9ef6cbd0d5a00c27870e4f85 -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/AssessmentSectionCompositionChangeHandlerTest.cs (.../AssessmentSectionCompositionChangeHandlerTest.cs) (revision cf55284bcecdef7b9ef6cbd0d5a00c27870e4f85) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/AssessmentSectionCompositionChangeHandlerTest.cs (.../AssessmentSectionCompositionChangeHandlerTest.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -132,7 +132,7 @@ public void ChangeComposition_ChangeToSameValue_DoNothing() { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); AssessmentSectionComposition originalComposition = assessmentSection.Composition; ICalculation[] calculationsWithOutput = assessmentSection.GetFailureMechanisms() .SelectMany(fm => fm.Calculations) @@ -171,7 +171,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); GrassCoverErosionOutwardsFailureMechanism grassCoverErosionOutwardsFailureMechanism = assessmentSection.GetFailureMechanisms() .OfType() @@ -187,7 +187,7 @@ .ToList(); IEnumerable expectedAffectedObjects = - duneErosionFailureMechanism.DuneLocations.Cast() + duneErosionFailureMechanism.DuneLocations.Where(dl => dl.Output != null).Cast() .Concat(grassCoverErosionOutwardsFailureMechanism.HydraulicBoundaryLocations) .Concat(new IObservable[] { @@ -238,7 +238,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); DuneErosionFailureMechanism duneErosionFailureMechanism = assessmentSection.GetFailureMechanisms() .OfType() @@ -249,7 +249,7 @@ .Where(calc => calc.HasOutput) .ToList(); - IEnumerable expectedAffectedObjects = duneErosionFailureMechanism.DuneLocations + IEnumerable expectedAffectedObjects = duneErosionFailureMechanism.DuneLocations.Where(dl => dl.Output != null) .Concat(new IObservable[] { assessmentSection, @@ -291,7 +291,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(assessmentSection); // Precondition @@ -306,7 +306,7 @@ .First(); IEnumerable expectedAffectedObjects = - duneErosionFailureMechanism.DuneLocations.Cast() + duneErosionFailureMechanism.DuneLocations.Where(dl => dl.Output != null).Cast() .Concat(grassCoverErosionOutwardsFailureMechanism.HydraulicBoundaryLocations) .Concat(new IObservable[] { @@ -350,7 +350,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(assessmentSection); // Precondition @@ -360,7 +360,7 @@ .OfType() .First(); - IEnumerable expectedAffectedObjects = duneErosionFailureMechanism.DuneLocations + IEnumerable expectedAffectedObjects = duneErosionFailureMechanism.DuneLocations.Where(dl => dl.Output != null) .Concat(new IObservable[] { assessmentSection, @@ -399,7 +399,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutputOfFailureMechanisms(assessmentSection); // Precondition @@ -443,7 +443,7 @@ AssessmentSectionComposition newComposition) { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(oldComposition); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(oldComposition); RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutputOfFailureMechanisms(assessmentSection); // Precondition Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs =================================================================== diff -u -r4bd863e75942710beedfe1ea7c2c5a097b46497f -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision 4bd863e75942710beedfe1ea7c2c5a097b46497f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/FailureMechanismContributionNormChangeHandlerTest.cs (.../FailureMechanismContributionNormChangeHandlerTest.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -27,6 +27,7 @@ using NUnit.Extensions.Forms; using NUnit.Framework; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.DuneErosion.Data; using Ringtoets.Integration.Data; @@ -151,11 +152,26 @@ public void ChangeNorm_FullyConfiguredAssessmentSection_AllCalculationOutputClearedAndContributionsUpdatedAndReturnsAllAffectedObjects() { // Setup - AssessmentSection section = TestDataGenerator.GetFullyConfiguredAssessmentSection(); - var expectedAffectedCalculations = section.GetFailureMechanisms() + AssessmentSection section = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); + ICalculation[] expectedAffectedCalculations = section.GetFailureMechanisms() .SelectMany(fm => fm.Calculations) .Where(c => c.HasOutput) .ToArray(); + + IEnumerable expectedAffectedObjects = + expectedAffectedCalculations.Cast() + .Concat(section.GetFailureMechanisms()) + .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations) + .Concat(section.HydraulicBoundaryDatabase.Locations) + .Concat(section.DuneErosion.DuneLocations.Where(dl => dl.Output != null)) + .Concat(new IObservable[] + { + section.FailureMechanismContribution, + section.GrassCoverErosionOutwards.HydraulicBoundaryLocations, + section.HydraulicBoundaryDatabase, + section.DuneErosion.DuneLocations + }).ToList(); + var handler = new FailureMechanismContributionNormChangeHandler(); IEnumerable affectedObjects = null; @@ -177,18 +193,6 @@ CollectionAssert.IsEmpty(section.GetFailureMechanisms().SelectMany(fm => fm.Calculations).Where(c => c.HasOutput), "There should be no calculations with output."); - var expectedAffectedObjects = expectedAffectedCalculations.Cast() - .Concat(section.GetFailureMechanisms()) - .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations) - .Concat(section.HydraulicBoundaryDatabase.Locations) - .Concat(section.DuneErosion.DuneLocations) - .Concat(new IObservable[] - { - section.FailureMechanismContribution, - section.GrassCoverErosionOutwards.HydraulicBoundaryLocations, - section.HydraulicBoundaryDatabase, - section.DuneErosion.DuneLocations - }); foreach (HydraulicBoundaryLocation location in section.HydraulicBoundaryDatabase.Locations .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations)) { @@ -206,12 +210,25 @@ public void ChangeNorm_FullyConfiguredAssessmentSectionWithoutCalculationOutput_NormChangedContributionsUpdatedAndReturnsAllAffectedObjects() { // Setup - AssessmentSection section = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection section = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(section); // Precondition CollectionAssert.IsEmpty(section.GetFailureMechanisms().SelectMany(fm => fm.Calculations).Where(c => c.HasOutput)); + IEnumerable expectedAffectedObjects = + section.GetFailureMechanisms().Cast() + .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations) + .Concat(section.HydraulicBoundaryDatabase.Locations) + .Concat(section.DuneErosion.DuneLocations.Where(dl => dl.Output != null)) + .Concat(new IObservable[] + { + section.FailureMechanismContribution, + section.GrassCoverErosionOutwards.HydraulicBoundaryLocations, + section.HydraulicBoundaryDatabase, + section.DuneErosion.DuneLocations + }).ToList(); + var handler = new FailureMechanismContributionNormChangeHandler(); IEnumerable affectedObjects = null; @@ -226,17 +243,6 @@ Assert.AreEqual(newNormValue, section.FailureMechanismContribution.Norm); - var expectedAffectedObjects = section.GetFailureMechanisms().Cast() - .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations) - .Concat(section.HydraulicBoundaryDatabase.Locations) - .Concat(section.DuneErosion.DuneLocations) - .Concat(new IObservable[] - { - section.FailureMechanismContribution, - section.GrassCoverErosionOutwards.HydraulicBoundaryLocations, - section.HydraulicBoundaryDatabase, - section.DuneErosion.DuneLocations - }); foreach (HydraulicBoundaryLocation location in section.HydraulicBoundaryDatabase.Locations .Concat(section.GrassCoverErosionOutwards.HydraulicBoundaryLocations)) { @@ -254,7 +260,7 @@ public void ChangeNorm_FullyConfiguredAssessmentSectionWithoutCalculatedHydraulicBoundaryLocations_AllFailureMechanismCalculationOutputClearedAndContributionsUpdatedAndReturnsAllAffectedObjects() { // Setup - AssessmentSection section = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection section = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(section.HydraulicBoundaryDatabase, section); // Precondition Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineReplacementHandlerTest.cs =================================================================== diff -u -r3c283aaf463f417b7769c26116b379959e4e405b -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineReplacementHandlerTest.cs (.../ReferenceLineReplacementHandlerTest.cs) (revision 3c283aaf463f417b7769c26116b379959e4e405b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineReplacementHandlerTest.cs (.../ReferenceLineReplacementHandlerTest.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -146,7 +146,7 @@ var viewCommands = mocks.Stub(); mocks.ReplayAll(); - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); var handler = new ReferenceLineReplacementHandler(viewCommands); var referenceLine = new ReferenceLine(); @@ -314,7 +314,7 @@ public void DoPostReplacementUpdates_AfterReplacingReferenceLine_CloseViewsForRemovedData() { // Setup - const int expectedNumberOfRemovedInstances = 102; + const int expectedNumberOfRemovedInstances = 112; var mocks = new MockRepository(); var viewCommands = mocks.StrictMock(); @@ -324,7 +324,7 @@ var handler = new ReferenceLineReplacementHandler(viewCommands); - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); handler.Replace(assessmentSection, new ReferenceLine()); // Call @@ -338,7 +338,7 @@ public void DoPostReplacementUpdates_CalledSecondTimeAfterReplaceAndUpdateCycle_DoNothing() { // Setup - const int expectedNumberOfRemovedInstances = 102; + const int expectedNumberOfRemovedInstances = 112; var mocks = new MockRepository(); var viewCommands = mocks.StrictMock(); @@ -348,7 +348,7 @@ var handler = new ReferenceLineReplacementHandler(viewCommands); - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); handler.Replace(assessmentSection, new ReferenceLine()); handler.DoPostReplacementUpdates(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs =================================================================== diff -u -rcf55284bcecdef7b9ef6cbd0d5a00c27870e4f85 -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision cf55284bcecdef7b9ef6cbd0d5a00c27870e4f85) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -68,7 +68,7 @@ public void ClearFailureMechanismCalculationOutputs_WithAssessmentSection_ClearsFailureMechanismCalculationsOutputAndReturnsAffectedCalculations() { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); IEnumerable expectedAffectedItems = assessmentSection.GetFailureMechanisms() .SelectMany(f => f.Calculations) .Where(c => c.HasOutput) @@ -145,7 +145,7 @@ public void ClearAllCalculationOutputAndHydraulicBoundaryLocations_VariousCalculations_ClearsHydraulicBoundaryLocationAndCalculationsAndReturnsAffectedObjects() { // Setup - var assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + var assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); var expectedAffectedItems = new List(); expectedAffectedItems.AddRange(assessmentSection.ClosingStructures.Calculations .Cast>() @@ -484,7 +484,7 @@ public void ClearReferenceLine_FullyConfiguredAssessmentSection_AllReferenceLineDependentDataCleared() { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); // Call RingtoetsDataSynchronizationService.ClearReferenceLine(assessmentSection); @@ -591,7 +591,7 @@ public void ClearReferenceLine_FullyConfiguredAssessmentSection_ClearResultsContainAllAffectedObjectsAndAllRemovedObjects() { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); IList expectedRemovedObjects = GetExpectedRemovedObjectsWhenClearingReferenceLine(assessmentSection); @@ -686,7 +686,7 @@ public void ClearReferenceLine_FullyConfiguredAssessmentSectionWithoutReferenceLine_ClearResultsDoesNotContainReferenceLineNorNullForRemovedObjects() { // Setup - AssessmentSection assessmentSection = TestDataGenerator.GetFullyConfiguredAssessmentSection(); + AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); ReferenceLine originalReferenceLine = assessmentSection.ReferenceLine; assessmentSection.ReferenceLine = null; Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils.Test/Ringtoets.Integration.TestUtils.Test.csproj =================================================================== diff -u -r5c426a1e8ae5225fb88d1960270bf2f3bf13153f -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils.Test/Ringtoets.Integration.TestUtils.Test.csproj (.../Ringtoets.Integration.TestUtils.Test.csproj) (revision 5c426a1e8ae5225fb88d1960270bf2f3bf13153f) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils.Test/Ringtoets.Integration.TestUtils.Test.csproj (.../Ringtoets.Integration.TestUtils.Test.csproj) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -41,20 +41,96 @@ MinimumRecommendedRules.ruleset + + ..\..\..\..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll + True + + + False + ..\..\..\..\..\Checkout_Dev\packages\System.Data.SQLite.Core.1.0.104.0\lib\net40\System.Data.SQLite.dll + Properties\GlobalAssembly.cs + Copying.licenseheader + + + + {3bbfd65b-b277-4e50-ae6d-bd24c3434609} + Core.Common.Base + + + {c6309704-d67b-434c-bc98-9f8910bc1d10} + Ringtoets.ClosingStructures.Data + + + {d4200f43-3f72-4f42-af0a-8ced416a38ec} + Ringtoets.Common.Data + + + {d1068432-c172-4aa6-847b-d9deb4c6de26} + Ringtoets.DuneErosion.Data + + + {90de728e-48ef-4665-ab38-3d88e41d9f4d} + Ringtoets.GrassCoverErosionInwards.Data + + + {e7225477-577f-4a17-b7ec-6721158e1543} + Ringtoets.GrassCoverErosionOutwards.Data + + + {1c0017d8-35b5-4ca0-8fc7-a83f46dbdc99} + Ringtoets.HeightStructures.Data + + + {ce994cc9-6f6a-48ac-b4be-02c30a21f4db} + Ringtoets.Piping.Data + + + {14c6f716-64e2-4bc4-a1ef-05865fcefa4c} + Ringtoets.Piping.Primitives + + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + + + {3d4b9740-8348-4434-8d77-b611fc6ee57f} + Ringtoets.StabilityPointStructures.Data + + + {b479e3af-7c34-488c-bb73-d324100d36c9} + Ringtoets.StabilityStoneCover.Data + + + {567e0b69-5280-41ce-add6-443725a61c86} + Ringtoets.WaveImpactAsphaltCover.Data + + + {11f1f874-45af-43e4-8ae5-15a5c9593e28} + Ringtoets.Integration.Data + + + {28811c4a-6c18-42c1-88b2-a03a3784e2d0} + Ringtoets.Integration.Service + + + {174ba68d-6176-4ac5-8dfd-98cdd2c4d971} + Ringtoets.Integration.TestUtils + + + + + \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj =================================================================== diff -u -ra59b471e3b6a02319f91b7317b3814a099ef0221 -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj (.../Ringtoets.Integration.TestUtils.csproj) (revision a59b471e3b6a02319f91b7317b3814a099ef0221) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/Ringtoets.Integration.TestUtils.csproj (.../Ringtoets.Integration.TestUtils.csproj) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -171,6 +171,10 @@ {c8383b76-b3f1-4e6e-b56c-527b469fa20a} Ringtoets.Integration.Plugin + + {28811c4a-6c18-42c1-88b2-a03a3784e2d0} + Ringtoets.Integration.Service + Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs =================================================================== diff -u -r4bd863e75942710beedfe1ea7c2c5a097b46497f -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs (.../TestDataGenerator.cs) (revision 4bd863e75942710beedfe1ea7c2c5a097b46497f) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtils/TestDataGenerator.cs (.../TestDataGenerator.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -35,6 +35,7 @@ using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.HeightStructures.Data; using Ringtoets.Integration.Data; +using Ringtoets.Integration.Service; using Ringtoets.Piping.Integration.TestUtils; using Ringtoets.Revetment.Data; using Ringtoets.StabilityPointStructures.Data; @@ -49,20 +50,22 @@ public static class TestDataGenerator { /// - /// Gets a fully configured . + /// Gets a fully configured with all possible configurations for the + /// parent and nested calculations of the failure mechanisms. /// /// A fully configured . - public static AssessmentSection GetFullyConfiguredAssessmentSection() + public static AssessmentSection GetAssessmentSectionWithAllCalculationConfigurations() { - return GetFullyConfiguredAssessmentSection(AssessmentSectionComposition.Dike); + return GetAssessmentSectionWithAllCalculationConfigurations(AssessmentSectionComposition.Dike); } /// - /// Gets a fully configured with a desired . + /// Gets a fully configured with a desired + /// and with all possible configurations for the parent and nested calculations of the failure mechanisms. /// /// The desired to initialize the with. /// A fully configured . - public static AssessmentSection GetFullyConfiguredAssessmentSection(AssessmentSectionComposition composition) + public static AssessmentSection GetAssessmentSectionWithAllCalculationConfigurations(AssessmentSectionComposition composition) { var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) { @@ -98,6 +101,37 @@ } /// + /// Gets a fully configured with a desired and + /// possible configurations of the parent and nested calculations, but without the output of the + /// , + /// and + /// + /// The desired to initialize the with. + /// A fully configured without the output of the and the + /// . + public static AssessmentSection GetAssessmentSectionWithAllCalculationConfigurationsWithoutHydraulicBoundaryLocationAndDuneOutput(AssessmentSectionComposition composition) + { + AssessmentSection assessmentSection = GetAssessmentSectionWithAllCalculationConfigurations(composition); + RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); + + return assessmentSection; + } + + /// + /// Gets a fully configured with a desired and + /// possible configurations of the parent and nested calculations, but without the calculation outputs. + /// + /// The desired to initiailize the with. + /// A fully configured , but without the calculation output. + public static AssessmentSection GetAssessmentSectionWithAllCalculationConfigurationsWithoutCalculationOutput(AssessmentSectionComposition composition) + { + AssessmentSection assessmentSection = GetAssessmentSectionWithAllCalculationConfigurations(composition); + RingtoetsDataSynchronizationService.ClearFailureMechanismCalculationOutputs(assessmentSection); + + return assessmentSection; + } + + /// /// Gets a fully configured . /// public static StabilityStoneCoverFailureMechanism GetFullyConfiguredStabilityStoneCoverFailureMechanism() @@ -235,7 +269,7 @@ failureMechanism.DikeProfiles.Add(dikeprofile2); var calculation = new GrassCoverErosionInwardsCalculation(); - var calculationWithOutput = new GrassCoverErosionInwardsCalculation + var calculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation = new GrassCoverErosionInwardsCalculation { InputParameters = { @@ -250,7 +284,6 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = dikeprofile2 }, Output = new GrassCoverErosionInwardsOutput(0, false, new ProbabilityAssessmentOutput(0, 0, 0, 0, 0), new DikeHeightAssessmentOutput(0, 0, 0, 0, 0, CalculationConvergence.CalculatedConverged)) @@ -262,9 +295,17 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var calculationWitDikeProfileAndHydraulicBoundaryLocation = new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + DikeProfile = dikeprofile2 + } + }; var subCalculation = new GrassCoverErosionInwardsCalculation(); - var subCalculationWithOutput = new GrassCoverErosionInwardsCalculation + var subCalculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation = new GrassCoverErosionInwardsCalculation { InputParameters = { @@ -279,7 +320,6 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = dikeprofile1 }, Output = new GrassCoverErosionInwardsOutput(0, false, new ProbabilityAssessmentOutput(0, 0, 0, 0, 0), new DikeHeightAssessmentOutput(0, 0, 0, 0, 0, CalculationConvergence.CalculatedConverged)) @@ -291,19 +331,29 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWitDikeProfileAndHydraulicBoundaryLocation = new GrassCoverErosionInwardsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + DikeProfile = dikeprofile2 + } + }; failureMechanism.CalculationsGroup.Children.Add(calculation); - failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); + failureMechanism.CalculationsGroup.Children.Add(calculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation); failureMechanism.CalculationsGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); failureMechanism.CalculationsGroup.Children.Add(calculationWithHydraulicBoundaryLocation); + failureMechanism.CalculationsGroup.Children.Add(calculationWitDikeProfileAndHydraulicBoundaryLocation); failureMechanism.CalculationsGroup.Children.Add(new CalculationGroup { Children = { subCalculation, - subCalculationWithOutput, + subCalculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithHydraulicBoundaryLocation, + subCalculationWitDikeProfileAndHydraulicBoundaryLocation } }); @@ -322,8 +372,8 @@ failureMechanism.AddSection(section1); failureMechanism.AddSection(section2); - failureMechanism.SectionResults.ElementAt(0).Calculation = calculationWithOutput; - failureMechanism.SectionResults.ElementAt(1).Calculation = subCalculationWithOutput; + failureMechanism.SectionResults.ElementAt(0).Calculation = calculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation; + failureMechanism.SectionResults.ElementAt(1).Calculation = subCalculationWithOutputAndDikeProfileAndHydraulicBoundaryLocation; } private static void SetFullyConfiguredFailureMechanism(HeightStructuresFailureMechanism failureMechanism, @@ -434,24 +484,23 @@ where TCalculationInput : StructuresInputBase, new() { var calculation = new StructuresCalculation(); - var calculationWithOutput = new StructuresCalculation + var calculationWithOutputAndHydraulicBoundaryLocation = new StructuresCalculation { InputParameters = { - HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 + HydraulicBoundaryLocation = hydraulicBoundaryLocation }, Output = new ProbabilityAssessmentOutput(0, 0, 0, 0, 0) }; - var calculationWithForeshoreProfile = new StructuresCalculation + var calculationWithHydraulicBoundaryLocationAndForeshoreProfile = new StructuresCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, ForeshoreProfile = profile1 } }; - var calculationWithOutputAndHydraulicBoundaryLocation = new StructuresCalculation + var calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfiles = new StructuresCalculation { InputParameters = { @@ -469,21 +518,20 @@ }; var subCalculation = new StructuresCalculation(); - var subCalculationWithOutput = new StructuresCalculation + var subCalculationWithOutputAndHydraulicBoundaryLocation = new StructuresCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile2 }, Output = new ProbabilityAssessmentOutput(0, 0, 0, 0, 0) }; - var subCalculationWithOutputAndHydraulicBoundaryLocation = new StructuresCalculation + var subCalculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile = new StructuresCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 + ForeshoreProfile = profile2 }, Output = new ProbabilityAssessmentOutput(0, 0, 0, 0, 0) }; @@ -494,20 +542,29 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile = new StructuresCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + ForeshoreProfile = profile1 + } + }; failureMechanism.CalculationsGroup.Children.Add(calculation); - failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); - failureMechanism.CalculationsGroup.Children.Add(calculationWithForeshoreProfile); failureMechanism.CalculationsGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); + failureMechanism.CalculationsGroup.Children.Add(calculationWithHydraulicBoundaryLocationAndForeshoreProfile); + failureMechanism.CalculationsGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfiles); failureMechanism.CalculationsGroup.Children.Add(calculationWithHydraulicBoundaryLocation); failureMechanism.CalculationsGroup.Children.Add(new CalculationGroup { Children = { subCalculation, - subCalculationWithOutput, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile, + subCalculationWithHydraulicBoundaryLocation, + subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile } }); } @@ -542,14 +599,12 @@ failureMechanism.ForeshoreProfiles.Add(profile1); failureMechanism.ForeshoreProfiles.Add(profile2); - var calculation = new StabilityStoneCoverWaveConditionsCalculation(); - var calculationWithOutput = new StabilityStoneCoverWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocation = new StabilityStoneCoverWaveConditionsCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 }, Output = new StabilityStoneCoverWaveConditionsOutput(Enumerable.Empty(), Enumerable.Empty()) @@ -562,7 +617,7 @@ ForeshoreProfile = profile1 } }; - var calculationWithOutputAndHydraulicBoundaryLocation = new StabilityStoneCoverWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile = new StabilityStoneCoverWaveConditionsCalculation { InputParameters = { @@ -581,7 +636,7 @@ }; var subCalculation = new StabilityStoneCoverWaveConditionsCalculation(); - var subCalculationWithOutput = new StabilityStoneCoverWaveConditionsCalculation + var subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile = new StabilityStoneCoverWaveConditionsCalculation { InputParameters = { @@ -596,7 +651,6 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 }, Output = new StabilityStoneCoverWaveConditionsOutput(Enumerable.Empty(), Enumerable.Empty()) @@ -608,20 +662,29 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile = new StabilityStoneCoverWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + ForeshoreProfile = profile2 + } + }; failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculation); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutput); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithForeshoreProfile); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithHydraulicBoundaryLocation); failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup { Children = { subCalculation, - subCalculationWithOutput, + subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithHydraulicBoundaryLocation, + subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile } }); } @@ -658,12 +721,11 @@ failureMechanism.ForeshoreProfiles.Add(profile2); var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation(); - var calculationWithOutput = new WaveImpactAsphaltCoverWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocation = new WaveImpactAsphaltCoverWaveConditionsCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 }, Output = new WaveImpactAsphaltCoverWaveConditionsOutput(Enumerable.Empty()) }; @@ -675,7 +737,7 @@ ForeshoreProfile = profile1 } }; - var calculationWithOutputAndHydraulicBoundaryLocation = new WaveImpactAsphaltCoverWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile = new WaveImpactAsphaltCoverWaveConditionsCalculation { InputParameters = { @@ -693,7 +755,7 @@ }; var subCalculation = new WaveImpactAsphaltCoverWaveConditionsCalculation(); - var subCalculationWithOutput = new WaveImpactAsphaltCoverWaveConditionsCalculation + var subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile = new WaveImpactAsphaltCoverWaveConditionsCalculation { InputParameters = { @@ -707,7 +769,6 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - ForeshoreProfile = profile1 }, Output = new WaveImpactAsphaltCoverWaveConditionsOutput(Enumerable.Empty()) }; @@ -718,20 +779,29 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile = new WaveImpactAsphaltCoverWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + ForeshoreProfile = profile2 + } + }; failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculation); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutput); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithForeshoreProfile); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithHydraulicBoundaryLocation); failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup { Children = { subCalculation, - subCalculationWithOutput, + subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithHydraulicBoundaryLocation, + subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile } }); } @@ -781,28 +851,27 @@ failureMechanism.ForeshoreProfiles.Add(profile2); var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); - var calculationWithOutput = new GrassCoverErosionOutwardsWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocation = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation, - ForeshoreProfile = profile1 + HydraulicBoundaryLocation = hydraulicBoundaryLocation, }, Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) }; - var calculationWithForeshoreProfile = new GrassCoverErosionOutwardsWaveConditionsCalculation + var calculationWitHydraulicBoundaryLocationAndhForeshoreProfile = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation, + HydraulicBoundaryLocation = hydraulicBoundaryLocation, ForeshoreProfile = profile1 } }; - var calculationWithOutputAndHydraulicBoundaryLocation = new GrassCoverErosionOutwardsWaveConditionsCalculation + var calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation, + HydraulicBoundaryLocation = hydraulicBoundaryLocation, ForeshoreProfile = profile2 }, Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) @@ -811,16 +880,16 @@ { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation + HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; var subCalculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); - var subCalculationWithOutput = new GrassCoverErosionOutwardsWaveConditionsCalculation + var subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation, + HydraulicBoundaryLocation = hydraulicBoundaryLocation, ForeshoreProfile = profile2 }, Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) @@ -829,49 +898,68 @@ { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation, - ForeshoreProfile = profile1 + HydraulicBoundaryLocation = hydraulicBoundaryLocation, }, Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) }; var subCalculationWithHydraulicBoundaryLocation = new GrassCoverErosionOutwardsWaveConditionsCalculation { InputParameters = { - HydraulicBoundaryLocation = internalHydroLocation + HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + InputParameters = + { + HydraulicBoundaryLocation = hydraulicBoundaryLocation, + ForeshoreProfile = profile2 + } + }; failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculation); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutput); - failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWitHydraulicBoundaryLocationAndhForeshoreProfile); + failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocationAndForeshoreProfile); failureMechanism.WaveConditionsCalculationGroup.Children.Add(calculationWithHydraulicBoundaryLocation); failureMechanism.WaveConditionsCalculationGroup.Children.Add(new CalculationGroup { Children = { subCalculation, - subCalculationWithOutput, + subCalculationWithOutputAndHydraulicBoundarLocationAndForeshoreProfile, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithHydraulicBoundaryLocation, + subCalculationWithHydraulicBoundaryLocationAndForeshoreProfile } }); } private static void SetFullyConfiguredFailureMechanism(DuneErosionFailureMechanism failureMechanism, HydraulicBoundaryLocation hydraulicBoundaryLocation) { - DuneLocation duneLocation = new DuneLocation(hydraulicBoundaryLocation.Id, - hydraulicBoundaryLocation.Name, - new Point2D(hydraulicBoundaryLocation.Location.X, hydraulicBoundaryLocation.Location.Y), - new DuneLocation.ConstructionProperties - { - CoastalAreaId = 7, - Offset = 20, - Orientation = 180, - D50 = 0.00008 - }) + var duneLocation = new DuneLocation(hydraulicBoundaryLocation.Id, + hydraulicBoundaryLocation.Name, + new Point2D(hydraulicBoundaryLocation.Location.X, hydraulicBoundaryLocation.Location.Y), + new DuneLocation.ConstructionProperties + { + CoastalAreaId = 7, + Offset = 20, + Orientation = 180, + D50 = 0.00008 + }); + + var duneLocationWithOutput = new DuneLocation(hydraulicBoundaryLocation.Id, + hydraulicBoundaryLocation.Name, + new Point2D(hydraulicBoundaryLocation.Location.X, hydraulicBoundaryLocation.Location.Y), + new DuneLocation.ConstructionProperties + { + CoastalAreaId = 7, + Offset = 20, + Orientation = 180, + D50 = 0.00008 + }) { Output = new DuneLocationOutput(CalculationConvergence.CalculatedConverged, new DuneLocationOutput.ConstructionProperties { @@ -882,6 +970,7 @@ }; failureMechanism.DuneLocations.Add(duneLocation); + failureMechanism.DuneLocations.Add(duneLocationWithOutput); } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Integration.TestUtils/PipingTestDataGenerator.cs =================================================================== diff -u -rd6d1b03ce8dc3c4e6bba565a85ea310f6196adea -r78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc --- Ringtoets/Piping/test/Ringtoets.Piping.Integration.TestUtils/PipingTestDataGenerator.cs (.../PipingTestDataGenerator.cs) (revision d6d1b03ce8dc3c4e6bba565a85ea310f6196adea) +++ Ringtoets/Piping/test/Ringtoets.Piping.Integration.TestUtils/PipingTestDataGenerator.cs (.../PipingTestDataGenerator.cs) (revision 78cc5b59d47ca61eb812d0c69c7a17a4570e4ddc) @@ -152,6 +152,14 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var calculationWithSurfaceLineAndStochasticSoilModel = new PipingCalculationScenario(new GeneralPipingInput()) + { + InputParameters = + { + SurfaceLine = surfaceline1, + StochasticSoilModel = stochasticSoilModel2 + } + }; var subCalculation = new PipingCalculationScenario(new GeneralPipingInput()); var subCalculationWithOutput = new PipingCalculationScenario(new GeneralPipingInput()) @@ -183,11 +191,20 @@ HydraulicBoundaryLocation = hydraulicBoundaryLocation } }; + var subCalculationWithSurfaceLineAndStochasticSoilModel = new PipingCalculationScenario(new GeneralPipingInput()) + { + InputParameters = + { + SurfaceLine = surfaceline1, + StochasticSoilModel = stochasticSoilModel2 + } + }; failureMechanism.CalculationsGroup.Children.Add(calculation); failureMechanism.CalculationsGroup.Children.Add(calculationWithOutput); failureMechanism.CalculationsGroup.Children.Add(calculationWithSurfaceLineAndSoilModel); failureMechanism.CalculationsGroup.Children.Add(calculationWithOutputAndHydraulicBoundaryLocation); + failureMechanism.CalculationsGroup.Children.Add(calculationWithSurfaceLineAndStochasticSoilModel); failureMechanism.CalculationsGroup.Children.Add(calculationWithHydraulicBoundaryLocation); failureMechanism.CalculationsGroup.Children.Add(new CalculationGroup { @@ -196,7 +213,8 @@ subCalculation, subCalculationWithOutput, subCalculationWithOutputAndHydraulicBoundaryLocation, - subCalculationWithHydraulicBoundaryLocation + subCalculationWithHydraulicBoundaryLocation, + subCalculationWithSurfaceLineAndStochasticSoilModel } }); }