Index: Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs
===================================================================
diff -u -r54c12cd1360987abd052df8dbe9bc1bdb9990857 -re78071f096ccc818755a252dff3d621aac358a20
--- Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision 54c12cd1360987abd052df8dbe9bc1bdb9990857)
+++ Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision e78071f096ccc818755a252dff3d621aac358a20)
@@ -57,12 +57,12 @@
/// Gets the encapsulated .
///
public FailureMechanismSection Section { get; }
-
+
///
/// Gets or sets whether the section is relevant.
///
public bool IsRelevant { get; set; }
-
+
///
/// Gets or sets the initial failure mechanism result.
///
@@ -88,9 +88,9 @@
/// Gets or sets whether further analysis is needed.
///
public bool FurtherAnalysisNeeded { get; set; }
-
+
///
- /// Gets or sets the value of the refined probability.
+ /// Gets or sets the value of the refined probability per failure mechanism section.
///
/// Thrown when is not in range [0,1].
public double RefinedSectionProbability
Index: Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs
===================================================================
diff -u -r54c12cd1360987abd052df8dbe9bc1bdb9990857 -re78071f096ccc818755a252dff3d621aac358a20
--- Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision 54c12cd1360987abd052df8dbe9bc1bdb9990857)
+++ Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision e78071f096ccc818755a252dff3d621aac358a20)
@@ -60,7 +60,7 @@
var exception = Assert.Throws(Call);
Assert.AreEqual("section", exception.ParamName);
}
-
+
[Test]
[SetCulture("nl-NL")]
[TestCase(-20)]
@@ -100,7 +100,7 @@
// Assert
Assert.AreEqual(newValue, result.ManualInitialFailureMechanismResultSectionProbability);
}
-
+
[Test]
[SetCulture("nl-NL")]
[TestCase(-20)]
Index: Riskeer/Piping/src/Riskeer.Piping.Data/PipingFailureMechanismSectionResult.cs
===================================================================
diff -u -rd8e61e1c316db2f6f06f05f4911fd26ea072a0a1 -re78071f096ccc818755a252dff3d621aac358a20
--- Riskeer/Piping/src/Riskeer.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision d8e61e1c316db2f6f06f05f4911fd26ea072a0a1)
+++ Riskeer/Piping/src/Riskeer.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision e78071f096ccc818755a252dff3d621aac358a20)
@@ -33,6 +33,7 @@
public class PipingFailureMechanismSectionResult : FailureMechanismSectionResult
{
private double manualInitialFailureMechanismResultProfileProbability;
+ private double refinedProfileProbability;
///
///
@@ -42,8 +43,10 @@
: base(section)
{
ManualInitialFailureMechanismResultProfileProbability = double.NaN;
+ ProbabilityRefinementType = ProbabilityRefinementType.Section;
+ RefinedProfileProbability = double.NaN;
}
-
+
///
/// Gets or sets the value of the manual initial failure mechanism result per profile as a probability.
///
@@ -59,5 +62,26 @@
manualInitialFailureMechanismResultProfileProbability = value;
}
}
+
+ ///
+ /// Gets or sets the probability refinement type.
+ ///
+ public ProbabilityRefinementType ProbabilityRefinementType { get; set; }
+
+ ///
+ /// Gets or sets the value of the refined probability per profile.
+ ///
+ /// Thrown when is not in range [0,1].
+ public double RefinedProfileProbability
+ {
+ get => refinedProfileProbability;
+ set
+ {
+ ProbabilityHelper.ValidateProbability(value, null,
+ RiskeerCommonDataResources.ArbitraryProbabilityFailureMechanismSectionResult_AssessmentProbability_Value_needs_to_be_in_Range_0_,
+ true);
+ refinedProfileProbability = value;
+ }
+ }
}
}
\ No newline at end of file
Index: Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs
===================================================================
diff -u -rd8e61e1c316db2f6f06f05f4911fd26ea072a0a1 -re78071f096ccc818755a252dff3d621aac358a20
--- Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs (.../PipingFailureMechanismSectionResultTest.cs) (revision d8e61e1c316db2f6f06f05f4911fd26ea072a0a1)
+++ Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs (.../PipingFailureMechanismSectionResultTest.cs) (revision e78071f096ccc818755a252dff3d621aac358a20)
@@ -39,6 +39,7 @@
// Assert
Assert.IsInstanceOf(sectionResult);
Assert.IsNaN(sectionResult.ManualInitialFailureMechanismResultProfileProbability);
+ Assert.AreEqual(ProbabilityRefinementType.Section, sectionResult.ProbabilityRefinementType);
}
[Test]
@@ -80,5 +81,45 @@
// Assert
Assert.AreEqual(newValue, result.ManualInitialFailureMechanismResultProfileProbability);
}
+
+ [Test]
+ [SetCulture("nl-NL")]
+ [TestCase(-20)]
+ [TestCase(-1e-6)]
+ [TestCase(1 + 1e-6)]
+ [TestCase(12)]
+ public void RefinedProfileProbability_InvalidValue_ThrowsArgumentOutOfRangeException(double newValue)
+ {
+ // Setup
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new PipingFailureMechanismSectionResult(section);
+
+ // Call
+ void Call() => result.RefinedProfileProbability = newValue;
+
+ // Assert
+ const string message = "De waarde voor de faalkans moet in het bereik [0,0, 1,0] liggen.";
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(Call, message);
+ }
+
+ [Test]
+ [TestCase(0)]
+ [TestCase(1e-6)]
+ [TestCase(0.5)]
+ [TestCase(1 - 1e-6)]
+ [TestCase(1)]
+ [TestCase(double.NaN)]
+ public void RefinedProfileProbability_ValidValue_NewValueSet(double newValue)
+ {
+ // Setup
+ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
+ var result = new PipingFailureMechanismSectionResult(section);
+
+ // Call
+ result.RefinedProfileProbability = newValue;
+
+ // Assert
+ Assert.AreEqual(newValue, result.RefinedProfileProbability);
+ }
}
}
\ No newline at end of file