Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationActivityTest.cs =================================================================== diff -u -r0a51f20ac93373a43f79bb4c6327bce1d46545c6 -rf109332b5185b4445e2f1b9386dc1fe4063ff20f --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationActivityTest.cs (.../HeightStructuresCalculationActivityTest.cs) (revision 0a51f20ac93373a43f79bb4c6327bce1d46545c6) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresCalculationActivityTest.cs (.../HeightStructuresCalculationActivityTest.cs) (revision f109332b5185b4445e2f1b9386dc1fe4063ff20f) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Base.Service; using NUnit.Framework; using Rhino.Mocks; @@ -52,5 +53,78 @@ mocks.VerifyAll(); } + + [Test] + public void ParameteredConstructor_CalculationNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new HeightStructuresFailureMechanism(); + + // Call + TestDelegate call = () => new HeightStructuresCalculationActivity(null, "", failureMechanism, assessmentSectionMock); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("calculation", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void ParameteredConstructor_HlcdDirectoryNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var failureMechanism = new HeightStructuresFailureMechanism(); + var calculation = new HeightStructuresCalculation(); + + // Call + TestDelegate call = () => new HeightStructuresCalculationActivity(calculation, null, failureMechanism, assessmentSectionMock); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("hlcdDirectory", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void ParameteredConstructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSectionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var calculation = new HeightStructuresCalculation(); + + // Call + TestDelegate call = () => new HeightStructuresCalculationActivity(calculation, "", null, assessmentSectionMock); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanism", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void ParameteredConstructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Setup + var failureMechanism = new HeightStructuresFailureMechanism(); + var calculation = new HeightStructuresCalculation(); + + // Call + TestDelegate call = () => new HeightStructuresCalculationActivity(calculation, "", failureMechanism, null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } } } \ No newline at end of file