Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -r487d53ee7ab88f79d75c4932266eaafe08df1a56 -recb753a5b17dd2e9cb0658ffb5a0a6d5a730c62f --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 487d53ee7ab88f79d75c4932266eaafe08df1a56) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision ecb753a5b17dd2e9cb0658ffb5a0a6d5a730c62f) @@ -80,7 +80,7 @@ mocks.ReplayAll(); // Call - TestDelegate test = () => new PipingInputContextProperties(null, handler); + TestDelegate test = () => new PipingInputContextProperties(null, () => (RoundedDouble) 1.1, handler); // Assert var exception = Assert.Throws(test); @@ -89,11 +89,12 @@ } [Test] - public void Constructor_HandlerNull_ThrowArgumentNullException() + public void Constructor_GetAssessmentLevelFuncNull_ThrowArgumentNullException() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); + var handler = mocks.Stub(); mocks.ReplayAll(); var calculationItem = new PipingCalculationScenario(new GeneralPipingInput()); @@ -107,15 +108,42 @@ assessmentSection); // Call - TestDelegate test = () => new PipingInputContextProperties(context, null); + TestDelegate test = () => new PipingInputContextProperties(context, null, handler); // Assert var exception = Assert.Throws(test); - Assert.AreEqual("handler", exception.ParamName); + Assert.AreEqual("getAssessmentLevelFunc", exception.ParamName); mocks.VerifyAll(); } [Test] + public void Constructor_PropertyChangeHandlerNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var calculationItem = new PipingCalculationScenario(new GeneralPipingInput()); + var failureMechanism = new PipingFailureMechanism(); + + var context = new PipingInputContext(calculationItem.InputParameters, + calculationItem, + Enumerable.Empty(), + Enumerable.Empty(), + failureMechanism, + assessmentSection); + + // Call + TestDelegate test = () => new PipingInputContextProperties(context, () => (RoundedDouble) 1.1, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("propertyChangeHandler", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] public void Constructor_WithParameters_ExpectedValues() { var mocks = new MockRepository();