Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsScenariosContext.cs =================================================================== diff -u -r766487194eab00bc9205f5cd29f269c9af5f2ab8 -r491373a8a03238c540e7f0c404bb9919d056cc33 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsScenariosContext.cs (.../GrassCoverErosionInwardsScenariosContext.cs) (revision 766487194eab00bc9205f5cd29f269c9af5f2ab8) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/GrassCoverErosionInwardsScenariosContext.cs (.../GrassCoverErosionInwardsScenariosContext.cs) (revision 491373a8a03238c540e7f0c404bb9919d056cc33) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Controls.PresentationObjects; using Ringtoets.Common.Data.Calculation; using Ringtoets.GrassCoverErosionInwards.Data; @@ -40,9 +41,17 @@ GrassCoverErosionInwardsFailureMechanism failureMechanism) : base(wrappedData) { + if (failureMechanism == null) + { + throw new ArgumentNullException("failureMechanism"); + } + ParentFailureMechanism = failureMechanism; } + /// + /// The parent failure mechanism of the calculation group. + /// public GrassCoverErosionInwardsFailureMechanism ParentFailureMechanism { get; private set; } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs =================================================================== diff -u -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 -r491373a8a03238c540e7f0c404bb9919d056cc33 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs (.../GrassCoverErosionInwardsScenariosContextTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsScenariosContextTest.cs (.../GrassCoverErosionInwardsScenariosContextTest.cs) (revision 491373a8a03238c540e7f0c404bb9919d056cc33) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Controls.PresentationObjects; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; @@ -45,5 +46,19 @@ Assert.AreSame(calculationGroup, context.WrappedData); Assert.AreSame(failureMechanism, context.ParentFailureMechanism); } + + [Test] + public void Constructor_FailureMechanismNull_ThrowArgumentNullException() + { + // Setup + var calculationGroup = new CalculationGroup(); + + // Call + TestDelegate test = () => new GrassCoverErosionInwardsScenariosContext(calculationGroup, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("failureMechanism", exception.ParamName); + } } } \ No newline at end of file