Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs =================================================================== diff -u -r852180bf875d11a6c2ca28380c5b9132d39d8207 -r9432a36c796db91be97b968d99e03e6a2f85f81b --- Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs (.../DesignWaterLevelCalculationsView.cs) (revision 852180bf875d11a6c2ca28380c5b9132d39d8207) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/DesignWaterLevelCalculationsView.cs (.../DesignWaterLevelCalculationsView.cs) (revision 9432a36c796db91be97b968d99e03e6a2f85f81b) @@ -47,7 +47,7 @@ public DesignWaterLevelCalculationsView(HydraulicBoundaryLocationCalculationsForTargetProbability calculationsForTargetProbability, IAssessmentSection assessmentSection, Func getCalculationIdentifierFunc) - : base(calculationsForTargetProbability?.HydraulicBoundaryLocationCalculations, assessmentSection) + : base(calculationsForTargetProbability?.HydraulicBoundaryLocationCalculations ?? throw new ArgumentNullException(nameof(calculationsForTargetProbability)), assessmentSection) { if (getCalculationIdentifierFunc == null) { Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs =================================================================== diff -u -r852180bf875d11a6c2ca28380c5b9132d39d8207 -r9432a36c796db91be97b968d99e03e6a2f85f81b --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs (.../DesignWaterLevelCalculationsViewTest.cs) (revision 852180bf875d11a6c2ca28380c5b9132d39d8207) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/DesignWaterLevelCalculationsViewTest.cs (.../DesignWaterLevelCalculationsViewTest.cs) (revision 9432a36c796db91be97b968d99e03e6a2f85f81b) @@ -70,6 +70,23 @@ } [Test] + public void Constructor_CalculationsForTargetProbabilityNull_ThrowsArgumentNullException() + { + // Setup + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mockRepository); + mockRepository.ReplayAll(); + + // Call + void Call() => new DesignWaterLevelCalculationsView(null, + assessmentSection, + () => "1/100"); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("calculationsForTargetProbability", exception.ParamName); + } + + [Test] public void Constructor_GetCalculationIdentifierFuncNull_ThrowsArgumentNullException() { // Setup @@ -309,7 +326,10 @@ HydraulicBoundaryLocationCalculation[] performedCalculations = null; guiService.Expect(ch => ch.CalculateDesignWaterLevels(null, null, int.MinValue, null)).IgnoreArguments().WhenCalled( - invocation => { performedCalculations = ((IEnumerable) invocation.Arguments[0]).ToArray(); }); + invocation => + { + performedCalculations = ((IEnumerable) invocation.Arguments[0]).ToArray(); + }); mockRepository.ReplayAll(); view.CalculationGuiService = guiService;