Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverWaveConditionsInputContextTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -rbb80820ff4a4e09793da242cb7b36ca2bce59c32 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverWaveConditionsInputContextTest.cs (.../StabilityStoneCoverWaveConditionsInputContextTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverWaveConditionsInputContextTest.cs (.../StabilityStoneCoverWaveConditionsInputContextTest.cs) (revision bb80820ff4a4e09793da242cb7b36ca2bce59c32) @@ -28,6 +28,7 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.TestUtil; using Ringtoets.Revetment.Data; using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; @@ -67,16 +68,18 @@ } }; - var input = new WaveConditionsInput(); + var calculation = new StabilityStoneCoverWaveConditionsCalculation(); // Call - var context = new StabilityStoneCoverWaveConditionsInputContext(input, - failureMechanism.ForeshoreProfiles, - assessmentSection); + var context = new StabilityStoneCoverWaveConditionsInputContext( + calculation.InputParameters, + calculation, + failureMechanism.ForeshoreProfiles, + assessmentSection); // Assert Assert.IsInstanceOf(context); - Assert.AreEqual(input, context.WrappedData); + Assert.AreEqual(calculation.InputParameters, context.WrappedData); CollectionAssert.AreEqual(failureMechanism.ForeshoreProfiles, context.ForeshoreProfiles); CollectionAssert.AreEqual(hydraulicBoundaryDatabase.Locations, context.HydraulicBoundaryLocations); mocks.VerifyAll(); @@ -93,9 +96,11 @@ var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call - TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext(null, - failureMechanism.ForeshoreProfiles, - assessmentSection); + TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext( + null, + null, + failureMechanism.ForeshoreProfiles, + assessmentSection); // Assert var exception = Assert.Throws(test); @@ -114,9 +119,11 @@ var input = new WaveConditionsInput(); // Call - TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext(input, - null, - assessmentSection); + TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext( + input, + new TestCalculation(), + null, + assessmentSection); // Assert var exception = Assert.Throws(test); @@ -125,17 +132,45 @@ } [Test] + public void Constructor_CalculationNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var input = new WaveConditionsInput(); + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + + // Call + + TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext( + input, + null, + failureMechanism.ForeshoreProfiles, + assessmentSection); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("calculation", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Setup var input = new WaveConditionsInput(); var failureMechanism = new StabilityStoneCoverFailureMechanism(); // Call - TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext(input, - failureMechanism.ForeshoreProfiles, - null); + TestDelegate test = () => new StabilityStoneCoverWaveConditionsInputContext( + input, + new TestCalculation(), + failureMechanism.ForeshoreProfiles, + null); + // Assert var exception = Assert.Throws(test); Assert.AreEqual("assessmentSection", exception.ParamName); @@ -152,7 +187,11 @@ var input = new WaveConditionsInput(); var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var context = new StabilityStoneCoverWaveConditionsInputContext(input, failureMechanism.ForeshoreProfiles, assessmentSection); + var context = new StabilityStoneCoverWaveConditionsInputContext( + input, + new TestCalculation(), + failureMechanism.ForeshoreProfiles, + assessmentSection); // Call IEnumerable locations = context.HydraulicBoundaryLocations;