Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs
===================================================================
diff -u -r9a001397536d9dcca5d009c8518478cdfcddbeca -r819a4413e76659295c4f62a5ccf204c19d2e7161
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 819a4413e76659295c4f62a5ccf204c19d2e7161)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.ComponentModel;
using Core.Common.Base;
using Core.Common.Gui.Attributes;
@@ -49,13 +50,22 @@
/// Creates a new instance of .
///
/// The instance to show the properties of.
- /// Handler responsible for handling effects of a property change.
+ /// Handler responsible for handling effects of a property change.
+ /// Thrown when any input parameter is null.
public GrassCoverErosionInwardsFailureMechanismContextProperties(
GrassCoverErosionInwardsFailureMechanismContext data,
- IFailureMechanismPropertyChangeHandler propertyChangeHandler)
+ IFailureMechanismPropertyChangeHandler handler)
{
+ if (data == null)
+ {
+ throw new ArgumentNullException("data");
+ }
+ if (handler == null)
+ {
+ throw new ArgumentNullException("handler");
+ }
Data = data;
- this.propertyChangeHandler = propertyChangeHandler;
+ propertyChangeHandler = handler;
}
#region Length effect parameters
@@ -72,7 +82,6 @@
}
set
{
-
if (propertyChangeHandler.ConfirmPropertyChange())
{
data.WrappedData.GeneralInput.N = value;
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs
===================================================================
diff -u -r9a001397536d9dcca5d009c8518478cdfcddbeca -r819a4413e76659295c4f62a5ccf204c19d2e7161
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 819a4413e76659295c4f62a5ccf204c19d2e7161)
@@ -19,6 +19,7 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System;
using System.ComponentModel;
using System.Linq;
using Core.Common.Base;
@@ -53,6 +54,40 @@
}
[Test]
+ public void Constructor_DataIsNull_ThrowArgumentNullException()
+ {
+ // Setup
+ var handler = CreateSimpleHandler();
+ mockRepository.ReplayAll();
+
+ // Call
+ TestDelegate test = () => new GrassCoverErosionInwardsFailureMechanismContextProperties(null, handler);
+
+ // Assert
+ var paramName = Assert.Throws(test).ParamName;
+ Assert.AreEqual("data", paramName);
+ mockRepository.VerifyAll();
+ }
+
+ [Test]
+ public void Constructor_ChangeHandlerIsNull_ThrowArgumentNullException()
+ {
+ // Setup
+ var assessmentSection = mockRepository.Stub();
+ mockRepository.ReplayAll();
+
+ // Call
+ TestDelegate test = () => new GrassCoverErosionInwardsFailureMechanismContextProperties(
+ new GrassCoverErosionInwardsFailureMechanismContext(new GrassCoverErosionInwardsFailureMechanism(), assessmentSection),
+ null);
+
+ // Assert
+ var paramName = Assert.Throws(test).ParamName;
+ Assert.AreEqual("handler", paramName);
+ mockRepository.VerifyAll();
+ }
+
+ [Test]
public void Constructor_ExpectedValues()
{
// Setup
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs
===================================================================
diff -u -r9a001397536d9dcca5d009c8518478cdfcddbeca -r819a4413e76659295c4f62a5ccf204c19d2e7161
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs) (revision 819a4413e76659295c4f62a5ccf204c19d2e7161)
@@ -58,7 +58,7 @@
}
[Test]
- public void CreateInstance_Always_SetsFailureMechanismContributionAsData()
+ public void CreateInstance_Always_NewPropertiesWithFailureMechanismContextAsData()
{
// Setup
var mocks = new MockRepository();
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs
===================================================================
diff -u -rf423289729b381361eed8bb5eacc7596a710d78a -r819a4413e76659295c4f62a5ccf204c19d2e7161
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs (.../PipingFailureMechanismContextProperties.cs) (revision f423289729b381361eed8bb5eacc7596a710d78a)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs (.../PipingFailureMechanismContextProperties.cs) (revision 819a4413e76659295c4f62a5ccf204c19d2e7161)
@@ -44,6 +44,7 @@
///
/// The instance to show the properties of.
/// Handler responsible for handling effects of a property change.
+ /// Thrown when any input parameter is null.
public PipingFailureMechanismContextProperties(
PipingFailureMechanismContext data,
IFailureMechanismPropertyChangeHandler handler)