Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -42,16 +42,20 @@
/// Thrown when is null.
public ClosingStructuresFailureMechanismSectionResultRow(ClosingStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs (.../ClosingStructuresFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs (.../ClosingStructuresFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -53,7 +53,7 @@
Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(ClosingStructuresFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(ClosingStructuresFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -173,16 +173,21 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new ClosingStructuresFailureMechanismSectionResult(CreateSection());
var row = new ClosingStructuresFailureMechanismSectionResultRow(sectionResult);
+ int nrOfExpectedDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(nrOfExpectedDecimals, actualAssessmentLayerThreeValue.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -130,7 +130,6 @@
Form
-
Fisheye: Tag e003fd6aa0759f680c6a33dba07f7b58c6ac52d5 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/TypeConverters/NoProbabilityValueRoundedDoubleConverter.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -121,7 +121,6 @@
-
Fisheye: Tag e003fd6aa0759f680c6a33dba07f7b58c6ac52d5 refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TypeConverters/NoProbabilityValueRoundedDoubleConverterTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -43,16 +43,20 @@
/// null.
public GrassCoverErosionInwardsFailureMechanismSectionResultRow(GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -26,6 +26,7 @@
using NUnit.Framework;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.TypeConverters;
using Ringtoets.Common.Forms.Views;
using Ringtoets.GrassCoverErosionInwards.Data;
@@ -52,7 +53,7 @@
Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(GrassCoverErosionInwardsFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(GrassCoverErosionInwardsFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -176,16 +177,21 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult(CreateSection());
var row = new GrassCoverErosionInwardsFailureMechanismSectionResultRow(sectionResult);
+ int nrOfExpectedDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(nrOfExpectedDecimals, sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()
Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -41,16 +41,20 @@
/// Thrown when is null.
public HeightStructuresFailureMechanismSectionResultRow(HeightStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -53,7 +53,7 @@
Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(HeightStructuresFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(HeightStructuresFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -173,16 +173,21 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new HeightStructuresFailureMechanismSectionResult(CreateSection());
var row = new HeightStructuresFailureMechanismSectionResultRow(sectionResult);
+ int nrOfExpectedDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(nrOfExpectedDecimals, actualAssessmentLayerThreeValue.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -56,16 +56,20 @@
this.calculations = calculations;
}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismSectionResultRowTest.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismSectionResultRowTest.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -27,6 +27,7 @@
using NUnit.Framework;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.TypeConverters;
using Ringtoets.Common.Forms.Views;
using Ringtoets.MacroStabilityInwards.Data;
@@ -53,7 +54,7 @@
Assert.AreEqual(result.GetAssessmentLayerTwoA(Enumerable.Empty()), row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(MacroStabilityInwardsFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(MacroStabilityInwardsFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -171,17 +172,22 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new MacroStabilityInwardsFailureMechanismSectionResult(CreateSection());
var row = new MacroStabilityInwardsFailureMechanismSectionResultRow(sectionResult,
Enumerable.Empty());
+ int nrOfExpectedDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(nrOfExpectedDecimals, actualAssessmentLayerThreeValue.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -56,16 +56,20 @@
this.calculations = calculations;
}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs (.../PipingFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs (.../PipingFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -27,6 +27,7 @@
using NUnit.Framework;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.FailureMechanism;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Forms.TypeConverters;
using Ringtoets.Common.Forms.Views;
using Ringtoets.Piping.Data;
@@ -53,7 +54,7 @@
Assert.AreEqual(result.GetAssessmentLayerTwoA(Enumerable.Empty()), row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(PipingFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(PipingFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -171,17 +172,22 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new PipingFailureMechanismSectionResult(CreateSection());
var row = new PipingFailureMechanismSectionResultRow(sectionResult,
Enumerable.Empty());
+ int nrOfExpectedDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(nrOfExpectedDecimals, actualAssessmentLayerThreeValue.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()
Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs
===================================================================
diff -u -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2)
+++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -54,16 +54,20 @@
}
}
- [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))]
- public RoundedDouble AssessmentLayerThree
+ ///
+ /// Gets or sets the value representing the result of the layer 3 assessment.
+ ///
+ [TypeConverter(typeof(NoProbabilityValueDoubleConverter))]
+ public double AssessmentLayerThree
{
get
{
return SectionResult.AssessmentLayerThree;
}
set
{
- SectionResult.AssessmentLayerThree = value;
+ int nrOfDecimals = SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+ SectionResult.AssessmentLayerThree = new RoundedDouble(nrOfDecimals, value);
}
}
Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -re003fd6aa0759f680c6a33dba07f7b58c6ac52d5
--- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe)
+++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision e003fd6aa0759f680c6a33dba07f7b58c6ac52d5)
@@ -53,7 +53,7 @@
Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA);
TestHelper.AssertTypeConverter(
nameof(StabilityPointStructuresFailureMechanismSectionResultRow.AssessmentLayerTwoA));
- TestHelper.AssertTypeConverter(
+ TestHelper.AssertTypeConverter(
nameof(StabilityPointStructuresFailureMechanismSectionResultRow.AssessmentLayerThree));
}
@@ -173,16 +173,21 @@
{
// Setup
var random = new Random(21);
- RoundedDouble assessmentLayerThree = random.NextRoundedDouble();
+ double assessmentLayerThree = random.NextDouble();
var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(CreateSection());
var row = new StabilityPointStructuresFailureMechanismSectionResultRow(sectionResult);
+ int expectedNrOfDecimals = sectionResult.AssessmentLayerThree.NumberOfDecimalPlaces;
+
// Call
row.AssessmentLayerThree = assessmentLayerThree;
// Assert
- Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree);
+ RoundedDouble actualAssessmentLayerThreeValue = sectionResult.AssessmentLayerThree;
+ Assert.AreEqual(assessmentLayerThree, actualAssessmentLayerThreeValue,
+ actualAssessmentLayerThreeValue.GetAccuracy());
+ Assert.AreEqual(expectedNrOfDecimals, actualAssessmentLayerThreeValue.NumberOfDecimalPlaces);
}
private static FailureMechanismSection CreateSection()