Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs =================================================================== diff -u -r631b6c404d5ad7dcca09ee6516425f7648d9c4b6 -r8e9d310857d397114266bac02c9b6fb714153252 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision 631b6c404d5ad7dcca09ee6516425f7648d9c4b6) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverFailurePathPropertiesTest.cs (.../StabilityStoneCoverFailurePathPropertiesTest.cs) (revision 8e9d310857d397114266bac02c9b6fb714153252) @@ -41,7 +41,7 @@ private const int contributionPropertyIndex = 3; private const int inAssemblyPropertyIndex = 4; private const int nPropertyIndex = 5; - private const int applySectionLengthInSectionPropertyIndex = 6; + private const int applyLengthEffectInSectionPropertyIndex = 6; [Test] public void Constructor_ExpectedValues() @@ -129,7 +129,7 @@ "N [-]", "De parameter 'N' die gebruikt wordt om het lengte-effect mee te nemen in de beoordeling."); - PropertyDescriptor applySectionLengthInSectionProperty = dynamicProperties[applySectionLengthInSectionPropertyIndex]; + PropertyDescriptor applySectionLengthInSectionProperty = dynamicProperties[applyLengthEffectInSectionPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(applySectionLengthInSectionProperty, lengthEffectCategory, "Toepassen lengte-effect binnen vak", @@ -235,7 +235,38 @@ mocks.VerifyAll(); } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void ApplyLengthEffectInSection_SetNewValue_NotifyObservers(bool applyLengthEffectInSection) + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + var failureMechanism = new StabilityStoneCoverFailureMechanism + { + GeneralInput = + { + ApplyLengthEffectInSection = !applyLengthEffectInSection + } + }; + + failureMechanism.Attach(observer); + + var properties = new StabilityStoneCoverFailurePathProperties(failureMechanism); + + // Call + properties.ApplyLengthEffectInSection = applyLengthEffectInSection; + + // Assert + Assert.AreEqual(applyLengthEffectInSection, failureMechanism.GeneralInput.ApplyLengthEffectInSection); + mocks.VerifyAll(); + } + [Test] [TestCase(true)] [TestCase(false)]