Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs =================================================================== diff -u -r533cfb6b8d9c3e198204d1c6ee022b79049e6d43 -rcfca0be21e050ae7ed7626ef4e3b1472eecc69a1 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 533cfb6b8d9c3e198204d1c6ee022b79049e6d43) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision cfca0be21e050ae7ed7626ef4e3b1472eecc69a1) @@ -24,6 +24,7 @@ using System.Linq; using Core.Common.Base; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.ClosingStructures.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; @@ -217,21 +218,19 @@ double waveHeight, double designWaterLevel) { // Setup - var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(waveHeight, designWaterLevel); - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) - { - HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - Locations = - { - hydraulicBoundaryLocation - } - } - }; + var mockRepository = new MockRepository(); + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub( + failureMechanism, mockRepository); + mockRepository.ReplayAll(); + HydraulicBoundaryLocation hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations[0]; + hydraulicBoundaryLocation.DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(designWaterLevel); + hydraulicBoundaryLocation.WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(waveHeight); + // Call IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput( - assessmentSection.HydraulicBoundaryDatabase, assessmentSection.GrassCoverErosionOutwards); + assessmentSectionStub.HydraulicBoundaryDatabase, failureMechanism); // Assert // Note: To make sure the clear is performed regardless of what is done with @@ -247,6 +246,7 @@ { hydraulicBoundaryLocation }, affectedObjects); + mockRepository.VerifyAll(); } [Test] @@ -367,27 +367,28 @@ double designWaterLevel, double waveHeight) { // Setup - var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(designWaterLevel, waveHeight); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase - { - Locations = - { - hydraulicBoundaryLocation - } - }; + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + var mockRepository = new MockRepository(); + IAssessmentSection assessmentSectionStub = AssessmentSectionHelper.CreateAssessmentSectionStub( + failureMechanism, mockRepository); + mockRepository.ReplayAll(); - var grassCoverErosionOutwardsHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(designWaterLevel, waveHeight); + HydraulicBoundaryLocation hydraulicBoundaryLocation = assessmentSectionStub.HydraulicBoundaryDatabase.Locations[0]; + hydraulicBoundaryLocation.DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(designWaterLevel); + hydraulicBoundaryLocation.WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(waveHeight); - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism + var grassCoverErosionOutwardsHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation { - HydraulicBoundaryLocations = - { - grassCoverErosionOutwardsHydraulicBoundaryLocation - } + DesignWaterLevelOutput = new TestHydraulicBoundaryLocationOutput(hydraulicBoundaryLocation.DesignWaterLevel), + WaveHeightOutput = new TestHydraulicBoundaryLocationOutput(hydraulicBoundaryLocation.WaveHeight) }; + failureMechanism.HydraulicBoundaryLocations.Add(grassCoverErosionOutwardsHydraulicBoundaryLocation); + // Call - IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput(hydraulicBoundaryDatabase, failureMechanism); + IEnumerable affectedObjects = RingtoetsDataSynchronizationService.ClearHydraulicBoundaryLocationOutput( + assessmentSectionStub.HydraulicBoundaryDatabase, + failureMechanism); // Assert // Note: To make sure the clear is performed regardless of what is done with @@ -413,6 +414,7 @@ grassCoverErosionOutwardsHydraulicBoundaryLocation, hydraulicBoundaryLocation }, affectedObjects); + mockRepository.VerifyAll(); } [Test]