Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs
===================================================================
diff -u -r269d51134bff0653b473b7e0bbc53b98c304ab7d -r450442a4c29c61e9b37f90a0f55ddf3252ecdec5
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 269d51134bff0653b473b7e0bbc53b98c304ab7d)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 450442a4c29c61e9b37f90a0f55ddf3252ecdec5)
@@ -97,34 +97,50 @@
}
///
- /// Gets or sets the tailor made assessment probability of the .
+ /// Gets the value representing the detailed assessment probability.
///
- /// Thrown when is
- /// not in the range [0,1].
[TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
- public double TailorMadeAssessmentProbability
+ public double DetailedAssessmentProbability
{
get
{
- return SectionResult.TailorMadeAssessmentProbability;
+ return SectionResult.GetDetailedAssessmentProbability(failureMechanism, assessmentSection);
}
+ }
+
+ ///
+ /// Gets or sets the value representing the tailor made assessment result.
+ ///
+ public TailorMadeAssessmentProbabilityCalculationResultType TailorMadeAssessmentResult
+ {
+ get
+ {
+ return SectionResult.TailorMadeAssessmentResult;
+ }
set
{
- SectionResult.TailorMadeAssessmentProbability = value;
+ SectionResult.TailorMadeAssessmentResult = value;
SectionResult.NotifyObservers();
}
}
///
- /// Gets the value representing the detailed assessment probability.
+ /// Gets or sets the tailor made assessment probability of the .
///
+ /// Thrown when is
+ /// not in the range [0,1].
[TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
- public double DetailedAssessmentProbability
+ public double TailorMadeAssessmentProbability
{
get
{
- return SectionResult.GetDetailedAssessmentProbability(failureMechanism, assessmentSection);
+ return SectionResult.TailorMadeAssessmentProbability;
}
+ set
+ {
+ SectionResult.TailorMadeAssessmentProbability = value;
+ SectionResult.NotifyObservers();
+ }
}
///
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r269d51134bff0653b473b7e0bbc53b98c304ab7d -r450442a4c29c61e9b37f90a0f55ddf3252ecdec5
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 269d51134bff0653b473b7e0bbc53b98c304ab7d)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 450442a4c29c61e9b37f90a0f55ddf3252ecdec5)
@@ -306,6 +306,33 @@
}
[Test]
+ public void TailorMadeAssessmentResult_SetNewValue_NotifyObserversAndPropertyChanged()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ var observer = mocks.StrictMock();
+ observer.Expect(o => o.UpdateObserver());
+ mocks.ReplayAll();
+
+ var random = new Random(39);
+ var newValue = random.NextEnumValue();
+
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new HeightStructuresFailureMechanismSectionResult(section);
+ result.Attach(observer);
+
+ var row = new HeightStructuresFailureMechanismSectionResultRow(result, new HeightStructuresFailureMechanism(), assessmentSection);
+
+ // Call
+ row.TailorMadeAssessmentResult = newValue;
+
+ // Assert
+ Assert.AreEqual(newValue, result.TailorMadeAssessmentResult);
+ mocks.VerifyAll();
+ }
+
+ [Test]
[TestCase(0)]
[TestCase(1)]
[TestCase(0.5)]