Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs =================================================================== diff -u -r132c4ee6a0ed99729bb298c1d62fcd9b3f5bdf9a -r62897474d0010cfce46ef62263c1ea2a2818ae35 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision 132c4ee6a0ed99729bb298c1d62fcd9b3f5bdf9a) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/PropertyClasses/StabilityPointStructuresFailureMechanismProperties.cs (.../StabilityPointStructuresFailureMechanismProperties.cs) (revision 62897474d0010cfce46ef62263c1ea2a2818ae35) @@ -20,9 +20,7 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.ComponentModel; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; @@ -49,28 +47,20 @@ private const int modelFactorCollisionLoadPropertyIndex = 8; private const int modelFactorLoadEffectPropertyIndex = 9; - private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; - /// /// Creates a new instance of . /// /// The instance to show the properties of. - /// Handler responsible for handling effects of a property change. - /// Thrown when any input parameter is null. - public StabilityPointStructuresFailureMechanismProperties( - StabilityPointStructuresFailureMechanism data, - IFailureMechanismPropertyChangeHandler handler) + /// Thrown when + /// is null. + public StabilityPointStructuresFailureMechanismProperties(StabilityPointStructuresFailureMechanism data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } + Data = data; - propertyChangeHandler = handler; } #region Length effect parameters Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs =================================================================== diff -u -r56246f10e7876b30f36a5b9709ec2e3332b4010a -r62897474d0010cfce46ef62263c1ea2a2818ae35 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 56246f10e7876b30f36a5b9709ec2e3332b4010a) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Plugin/StabilityPointStructuresPlugin.cs (.../StabilityPointStructuresPlugin.cs) (revision 62897474d0010cfce46ef62263c1ea2a2818ae35) @@ -70,9 +70,7 @@ { yield return new PropertyInfo { - CreateInstance = context => new StabilityPointStructuresFailureMechanismProperties( - context.WrappedData, - new FailureMechanismPropertyChangeHandler()) + CreateInstance = context => new StabilityPointStructuresFailureMechanismProperties(context.WrappedData) }; yield return new PropertyInfo(); yield return new PropertyInfo Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs =================================================================== diff -u -r132c4ee6a0ed99729bb298c1d62fcd9b3f5bdf9a -r62897474d0010cfce46ef62263c1ea2a2818ae35 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 132c4ee6a0ed99729bb298c1d62fcd9b3f5bdf9a) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/PropertyClasses/StabilityPointStructuresFailureMechanismPropertiesTest.cs (.../StabilityPointStructuresFailureMechanismPropertiesTest.cs) (revision 62897474d0010cfce46ef62263c1ea2a2818ae35) @@ -28,8 +28,6 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.TestUtil; -using Ringtoets.Common.Forms.PropertyClasses; -using Ringtoets.Common.Forms.TestUtil; using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityPointStructures.Forms.PropertyClasses; @@ -51,51 +49,27 @@ [Test] public void Constructor_DataIsNull_ThrowArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var changeHandler = - mocks.Stub>(); - mocks.ReplayAll(); - // Call - TestDelegate test = () => new StabilityPointStructuresFailureMechanismProperties(null, changeHandler); + TestDelegate test = () => new StabilityPointStructuresFailureMechanismProperties(null); // Assert string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("data", paramName); - mocks.VerifyAll(); } [Test] - public void Constructor_ChangeHandlerIsNull_ThrowArgumentNullException() - { - // Call - TestDelegate test = () => new StabilityPointStructuresFailureMechanismProperties( - new StabilityPointStructuresFailureMechanism(), - null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("handler", paramName); - } - - [Test] [TestCase(true)] [TestCase(false)] public void Constructor_ValidValues_ExpectedValues(bool isRelevant) { // Setup - var mocks = new MockRepository(); - var changeHandler = mocks.Stub>(); - mocks.ReplayAll(); - var failureMechanism = new StabilityPointStructuresFailureMechanism { IsRelevant = isRelevant }; // Call - var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, changeHandler); + var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism); // Assert Assert.IsInstanceOf>(properties); @@ -122,17 +96,13 @@ public void Constructor_IsRelevantTrue_PropertiesHaveExpectedAttributesValues() { // Setup - var mocks = new MockRepository(); - var changeHandler = mocks.Stub>(); - mocks.ReplayAll(); - var failureMechanism = new StabilityPointStructuresFailureMechanism { IsRelevant = true }; // Call - var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, changeHandler); + var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism); // Assert const string generalCategory = "Algemeen"; @@ -207,24 +177,19 @@ "Modelfactor belastingeffect [-]", "Modelfactor belastingeffect.", true); - mocks.VerifyAll(); } [Test] public void Constructor_IsRelevantFalse_PropertiesHaveExpectedAttributesValues() { // Setup - var mocks = new MockRepository(); - var changeHandler = mocks.Stub>(); - mocks.ReplayAll(); - var failureMechanism = new StabilityPointStructuresFailureMechanism { IsRelevant = false }; // Call - var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, changeHandler); + var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism); // Assert const string generalCategory = "Algemeen"; @@ -252,7 +217,6 @@ "Is relevant", "Geeft aan of dit toetsspoor relevant is of niet.", true); - mocks.VerifyAll(); } [Test] @@ -270,13 +234,8 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); failureMechanism.Attach(observer); - var changeHandler = new FailureMechanismSetPropertyValueAfterConfirmationParameterTester( - failureMechanism, - value, - new IObservable[0]); + var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism); - var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, changeHandler); - // Call TestDelegate test = () => properties.N = (RoundedDouble) value; @@ -301,13 +260,8 @@ var failureMechanism = new StabilityPointStructuresFailureMechanism(); failureMechanism.Attach(observer); - var changeHandler = new FailureMechanismSetPropertyValueAfterConfirmationParameterTester( - failureMechanism, - value, - new IObservable[0]); + var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism); - var properties = new StabilityPointStructuresFailureMechanismProperties(failureMechanism, changeHandler); - // Call properties.N = (RoundedDouble) value; @@ -322,16 +276,11 @@ public void DynamicVisibleValidationMethod_DependingOnRelevancy_ReturnExpectedVisibility(bool isRelevant) { // Setup - var mocks = new MockRepository(); - var changeHandler = mocks.Stub>(); - mocks.ReplayAll(); - var properties = new StabilityPointStructuresFailureMechanismProperties( new StabilityPointStructuresFailureMechanism { IsRelevant = isRelevant - }, - changeHandler); + }); // Call & Assert Assert.IsTrue(properties.DynamicVisibleValidationMethod(nameof(properties.Name))); @@ -346,8 +295,6 @@ Assert.AreEqual(isRelevant, properties.DynamicVisibleValidationMethod(nameof(properties.ModelFactorLoadEffect))); Assert.IsTrue(properties.DynamicVisibleValidationMethod(null)); - - mocks.VerifyAll(); } } } \ No newline at end of file