Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -43,15 +43,15 @@ public ClosingStructuresFailureMechanismSectionResultRow(ClosingStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {} [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -30,8 +30,6 @@ /// public abstract class FailureMechanismSectionResult : Observable { - private RoundedDouble assessmentLayerThreeValue; - /// /// Creates a new instance of . /// @@ -45,7 +43,6 @@ } Section = section; AssessmentLayerOne = AssessmentLayerOneState.NotAssessed; - AssessmentLayerThree = RoundedDouble.NaN; } /// @@ -54,37 +51,8 @@ public AssessmentLayerOneState AssessmentLayerOne { get; set; } /// - /// Gets or sets the value of the tailored assessment of safety. - /// - /// Thrown when - /// is outside of the valid ranges. - public RoundedDouble AssessmentLayerThree - { - get - { - return assessmentLayerThreeValue; - } - set - { - assessmentLayerThreeValue = ValidateAssessmentLayerThree(value); - } - } - - /// /// Gets the encapsulated . /// public FailureMechanismSection Section { get; private set; } - - /// - /// Validates the value of the tailored assessment of safety - /// - /// The value to validate. - /// The validated value. - /// Thrown when - /// is outside of the valid ranges. - protected virtual RoundedDouble ValidateAssessmentLayerThree(RoundedDouble value) - { - return value; - } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresFailureMechanismSectionResult.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresFailureMechanismSectionResult.cs (.../StructuresFailureMechanismSectionResult.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresFailureMechanismSectionResult.cs (.../StructuresFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -34,23 +34,40 @@ /// for the whole section. public class StructuresFailureMechanismSectionResult : FailureMechanismSectionResult where T : IStructuresCalculationInput, new() { + private RoundedDouble assessmentLayerThree; + /// /// Initializes a new instance of . /// /// The to get the result from. /// Thrown when is null. - protected StructuresFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + protected StructuresFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } /// /// Gets or sets the , which is chosen /// to be representative for the whole section. /// public StructuresCalculation Calculation { get; set; } - protected override RoundedDouble ValidateAssessmentLayerThree(RoundedDouble value) + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + /// Thrown when + /// is outside of the valid ranges. + public RoundedDouble AssessmentLayerThree { - ProbabilityHelper.ValidateProbability(value, null, true); - return value; + get + { + return assessmentLayerThree; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, true); + assessmentLayerThree = value; + } } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionResultRow.cs (.../FailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionResultRow.cs (.../FailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -77,22 +77,6 @@ } /// - /// Gets or sets the value representing the result of the layer 3 assessment. - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public virtual RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); - } - } - - /// /// Gets the that is the source of this row. /// protected T SectionResult { get; } Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,11 +20,9 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.Common.Data.Test.FailureMechanism { @@ -43,7 +41,6 @@ // Assert Assert.IsInstanceOf(result); Assert.AreEqual(AssessmentLayerOneState.NotAssessed, result.AssessmentLayerOne); - Assert.IsNaN(result.AssessmentLayerThree); Assert.AreSame(section, result.Section); } @@ -75,25 +72,6 @@ Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerOne); } - [Test] - [TestCase(double.NaN)] - [TestCase(double.PositiveInfinity)] - [TestCase(double.NegativeInfinity)] - [TestCase(5)] - [TestCase(0.5)] - public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) - { - // Setup - FailureMechanismSection section = CreateSection(); - var failureMechanismSectionResult = new TestFailureMechanismSectionResult(section); - - // Call - failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); - } - private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("test", new[] Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs =================================================================== diff -u -r2cd2b6b5b050b005019185c1c2a4dd28ae0e2ad2 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs (.../StructuresFailureMechanismSectionResultTest.cs) (revision 2cd2b6b5b050b005019185c1c2a4dd28ae0e2ad2) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresFailureMechanismSectionResultTest.cs (.../StructuresFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -104,7 +104,6 @@ Assert.AreEqual(validValue, sectionResult.AssessmentLayerThree, sectionResult.AssessmentLayerThree.GetAccuracy()); } - private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("Section", new[] Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs (.../TestFailureMechanismSectionResultTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs (.../TestFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -56,7 +55,6 @@ // Assert Assert.IsInstanceOf(result); Assert.AreEqual(AssessmentLayerOneState.NotAssessed, result.AssessmentLayerOne); - Assert.AreEqual(RoundedDouble.NaN, result.AssessmentLayerThree); Assert.AreSame(section, result.Section); } } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs (.../FailureMechanismSectionResultRowTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs (.../FailureMechanismSectionResultRowTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -21,14 +21,11 @@ using System; using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; -using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; -using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; namespace Ringtoets.Common.Forms.Test.Views @@ -60,10 +57,6 @@ // Assert Assert.AreEqual(section.Name, row.Name); Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - TestHelper.AssertTypeConverter( - nameof(TestFailureMechanismSectionResultRow.AssessmentLayerThree)); } [Test] @@ -93,23 +86,6 @@ mocks.VerifyAll(); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - double newValue = random.NextDouble(); - FailureMechanismSection section = CreateSection(); - var result = new TestFailureMechanismSectionResult(section); - var row = new TestFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); - } - private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("name", new[] Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismSectionResult.cs =================================================================== diff -u -r330f2e86f2fb575c436cdbb46b6d31bc246ef6fc -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismSectionResult.cs (.../DuneErosionFailureMechanismSectionResult.cs) (revision 330f2e86f2fb575c436cdbb46b6d31bc246ef6fc) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Data/DuneErosionFailureMechanismSectionResult.cs (.../DuneErosionFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.DuneErosion.Data @@ -39,12 +40,18 @@ public DuneErosionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionSectionResultRow.cs =================================================================== diff -u -r330f2e86f2fb575c436cdbb46b6d31bc246ef6fc -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionSectionResultRow.cs (.../DuneErosionSectionResultRow.cs) (revision 330f2e86f2fb575c436cdbb46b6d31bc246ef6fc) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Views/DuneErosionSectionResultRow.cs (.../DuneErosionSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.DuneErosion.Data; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismSectionResultTest.cs =================================================================== diff -u -r330f2e86f2fb575c436cdbb46b6d31bc246ef6fc -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismSectionResultTest.cs (.../DuneErosionFailureMechanismSectionResultTest.cs) (revision 330f2e86f2fb575c436cdbb46b6d31bc246ef6fc) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismSectionResultTest.cs (.../DuneErosionFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.DuneErosion.Data.Test { @@ -32,10 +34,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new DuneErosionFailureMechanismSectionResult(section); @@ -44,6 +43,35 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + var section = CreateSection(); + var result = new DuneErosionFailureMechanismSectionResult(section); + + // Call + result.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, result.AssessmentLayerThree, + result.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -32,12 +32,17 @@ /// public class GrassCoverErosionInwardsFailureMechanismSectionResult : FailureMechanismSectionResult { + private RoundedDouble assessmentLayerThreeValue; + /// /// Creates a new instance of . /// /// The to get the result from. /// Thrown when is null. - public GrassCoverErosionInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public GrassCoverErosionInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + assessmentLayerThreeValue = RoundedDouble.NaN; + } /// /// Gets the value of assessment layer two a. @@ -60,10 +65,22 @@ /// public GrassCoverErosionInwardsCalculation Calculation { get; set; } - protected override RoundedDouble ValidateAssessmentLayerThree(RoundedDouble value) + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + /// Thrown when + /// is outside of the valid ranges. + public RoundedDouble AssessmentLayerThree { - ProbabilityHelper.ValidateProbability(value, null, true); - return value; + get + { + return assessmentLayerThreeValue; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, true); + assessmentLayerThreeValue = value; + } } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -44,15 +44,15 @@ public GrassCoverErosionInwardsFailureMechanismSectionResultRow(GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResult.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.GrassCoverErosionOutwards.Data @@ -39,12 +40,18 @@ public GrassCoverErosionOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.GrassCoverErosionOutwards.Data; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.GrassCoverErosionOutwards.Data.Test { @@ -32,17 +34,43 @@ public void Constructor_WithSection_ResultCreatedForSection() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -rfcd32c8e949b4581cc20adcaa7cf7639fcb69d20 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision fcd32c8e949b4581cc20adcaa7cf7639fcb69d20) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,13 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.GrassCoverErosionOutwards.Forms.Views; @@ -44,6 +48,9 @@ // Assert Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); + + TestHelper.AssertTypeConverter( + nameof(GrassCoverErosionOutwardsFailureMechanismSectionResultRow.AssessmentLayerThree)); } [Test] @@ -62,6 +69,23 @@ Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + [Test] + public void AssessmentLayerThree_ValueSet_ReturnExpectedValue() + { + // Setup + var random = new Random(21); + RoundedDouble assessmentLayerThree = random.NextRoundedDouble(); + + var sectionResult = new GrassCoverErosionOutwardsFailureMechanismSectionResult(CreateSection()); + var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(sectionResult); + + // Call + row.AssessmentLayerThree = assessmentLayerThree; + + // Assert + Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree); + } + private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("name", new[] Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -42,15 +42,15 @@ public HeightStructuresFailureMechanismSectionResultRow(HeightStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {} [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -39,12 +40,18 @@ public GrassCoverSlipOffInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -39,12 +40,18 @@ public GrassCoverSlipOffOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResult.cs (.../MacrostabilityOutwardsFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResult.cs (.../MacrostabilityOutwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -46,6 +46,7 @@ public MacrostabilityOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = double.NaN; + AssessmentLayerThree = RoundedDouble.NaN; } /// @@ -69,5 +70,10 @@ assessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (.../MicrostabilityFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (.../MicrostabilityFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -39,12 +40,18 @@ public MicrostabilityFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (.../PipingStructureFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (.../PipingStructureFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -39,12 +40,18 @@ public PipingStructureFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -36,6 +37,14 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -36,6 +37,14 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResult.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -36,6 +37,14 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public WaterPressureAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public WaterPressureAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs (.../GrassCoverSlipOffOutwardsSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs (.../GrassCoverSlipOffOutwardsSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs (.../MacrostabilityOutwardsSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs (.../MacrostabilityOutwardsSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -21,6 +21,7 @@ using System; using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -57,5 +58,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs (.../MicrostabilitySectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs (.../MicrostabilitySectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -54,5 +57,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs (.../PipingStructureSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs (.../PipingStructureSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,9 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -37,5 +40,21 @@ /// so that it can be displayed as a row. /// Thrown when is null. public StrengthStabilityLengthwiseConstructionSectionResultRow(StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult sectionResult) : base(sectionResult) {} + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,9 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -37,5 +40,21 @@ /// so that it can be displayed as a row. /// Thrown when is null. public TechnicalInnovationSectionResultRow(TechnicalInnovationFailureMechanismSectionResult sectionResult) : base(sectionResult) {} + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,9 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; @@ -37,5 +40,21 @@ /// so that it can be displayed as a row. /// Thrown when is null. public WaterPressureAsphaltCoverSectionResultRow(WaterPressureAsphaltCoverFailureMechanismSectionResult sectionResult) : base(sectionResult) {} + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj =================================================================== diff -u -r7b7bd75dc1c1327386c9be96b5d480565bb8ecd6 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj (.../Ringtoets.Integration.Data.Test.csproj) (revision 7b7bd75dc1c1327386c9be96b5d480565bb8ecd6) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj (.../Ringtoets.Integration.Data.Test.csproj) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -83,6 +83,10 @@ {c6309704-d67b-434c-bc98-9f8910bc1d10} Ringtoets.ClosingStructures.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {d1068432-c172-4aa6-847b-d9deb4c6de26} Ringtoets.DuneErosion.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,10 +35,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); @@ -45,6 +44,36 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + + var failureMechanismSectionResult = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,10 +35,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(section); @@ -45,6 +44,36 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble)newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + var section = new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + return section; + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,9 +20,11 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -43,6 +45,7 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.IsNaN(result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } [Test] @@ -86,6 +89,25 @@ Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + var failureMechanismSectionResult = new MacrostabilityOutwardsFailureMechanismSectionResult(CreateSection()); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble)newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("Section", new[] Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResultTest.cs (.../MicrostabilityFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResultTest.cs (.../MicrostabilityFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,10 +35,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new MicrostabilityFailureMechanismSectionResult(section); @@ -45,6 +44,35 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new MicrostabilityFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs (.../PipingStructureFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs (.../PipingStructureFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,10 +35,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new PipingStructureFailureMechanismSectionResult(section); @@ -45,6 +44,35 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new PipingStructureFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,17 +35,43 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,17 +35,43 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new TechnicalInnovationFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new TechnicalInnovationFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Ringtoets.Integration.Data.Test.StandAlone.SectionResults @@ -33,17 +35,43 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new WaterPressureAsphaltCoverFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new WaterPressureAsphaltCoverFailureMechanismSectionResult(section); + + // Call + failureMechanismSectionResult.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerThree, + failureMechanismSectionResult.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanismSectionResult.cs (.../MacroStabilityInwardsFailureMechanismSectionResult.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/MacroStabilityInwardsFailureMechanismSectionResult.cs (.../MacroStabilityInwardsFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -32,17 +32,34 @@ /// public class MacroStabilityInwardsFailureMechanismSectionResult : FailureMechanismSectionResult { + private RoundedDouble assessmentLayerThree; + /// /// Creates a new instance of . /// /// The to get the result from. /// Thrown when is null. - public MacroStabilityInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public MacroStabilityInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } - protected override RoundedDouble ValidateAssessmentLayerThree(RoundedDouble value) + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + /// Thrown when + /// is outside of the valid ranges. + public RoundedDouble AssessmentLayerThree { - ProbabilityHelper.ValidateProbability(value, null, true); - return value; + get + { + return assessmentLayerThree; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, true); + assessmentLayerThree = value; + } } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Views/MacroStabilityInwardsFailureMechanismSectionResultRow.cs (.../MacroStabilityInwardsFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -57,15 +57,15 @@ } [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs =================================================================== diff -u -rb6e0f8d41d92ed18c902138dd49cce6e703ee883 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision b6e0f8d41d92ed18c902138dd49cce6e703ee883) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -32,17 +32,34 @@ /// public class PipingFailureMechanismSectionResult : FailureMechanismSectionResult { + private RoundedDouble assessmentLayerThree; + /// /// Creates a new instance of . /// /// The to get the result from. /// Thrown when is null. - public PipingFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + public PipingFailureMechanismSectionResult(FailureMechanismSection section) : base(section) + { + AssessmentLayerThree = RoundedDouble.NaN; + } - protected override RoundedDouble ValidateAssessmentLayerThree(RoundedDouble value) + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + /// Thrown when + /// is outside of the valid ranges. + public RoundedDouble AssessmentLayerThree { - ProbabilityHelper.ValidateProbability(value, null, true); - return value; + get + { + return assessmentLayerThree; + } + set + { + ProbabilityHelper.ValidateProbability(value, null, true); + assessmentLayerThree = value; + } } } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -57,15 +57,15 @@ } [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r0aacf2dc29138c69f365fe26a143d4e83b172dbe -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision 0aacf2dc29138c69f365fe26a143d4e83b172dbe) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -55,15 +55,15 @@ } [TypeConverter(typeof(NoProbabilityValueRoundedDoubleConverter))] - public override RoundedDouble AssessmentLayerThree + public RoundedDouble AssessmentLayerThree { get { - return base.AssessmentLayerThree; + return SectionResult.AssessmentLayerThree; } set { - base.AssessmentLayerThree = value; + SectionResult.AssessmentLayerThree = value; } } Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r94f2ec1496623ae488b567f883e66b4d26243441 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs (.../StabilityStoneCoverFailureMechanismSectionResult.cs) (revision 94f2ec1496623ae488b567f883e66b4d26243441) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs (.../StabilityStoneCoverFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.StabilityStoneCover.Data @@ -39,12 +40,18 @@ public StabilityStoneCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs =================================================================== diff -u -r94f2ec1496623ae488b567f883e66b4d26243441 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs (.../StabilityStoneCoverSectionResultRow.cs) (revision 94f2ec1496623ae488b567f883e66b4d26243441) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs (.../StabilityStoneCoverSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.StabilityStoneCover.Data; @@ -54,5 +57,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r94f2ec1496623ae488b567f883e66b4d26243441 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs (.../StabilityStoneCoverFailureMechanismSectionResultTest.cs) (revision 94f2ec1496623ae488b567f883e66b4d26243441) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs (.../StabilityStoneCoverFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.StabilityStoneCover.Data.Test { @@ -32,10 +34,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new StabilityStoneCoverFailureMechanismSectionResult(section); @@ -44,6 +43,35 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var result = new StabilityStoneCoverFailureMechanismSectionResult(section); + + // Call + result.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, result.AssessmentLayerThree, + result.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs =================================================================== diff -u -r94f2ec1496623ae488b567f883e66b4d26243441 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision 94f2ec1496623ae488b567f883e66b4d26243441) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -48,6 +48,8 @@ // Assert Assert.IsInstanceOf>(row); + TestHelper.AssertTypeConverter( + nameof(StabilityStoneCoverSectionResultRow.AssessmentLayerThree)); } [Test] Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r08d25a2d4cd349395730ef39d3abf2cc51c30508 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResult.cs) (revision 08d25a2d4cd349395730ef39d3abf2cc51c30508) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResult.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.WaveImpactAsphaltCover.Data @@ -39,12 +40,18 @@ public WaveImpactAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = AssessmentLayerTwoAResult.NotCalculated; + AssessmentLayerThree = RoundedDouble.NaN; } /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section, for which /// the result is a value of . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs =================================================================== diff -u -r08d25a2d4cd349395730ef39d3abf2cc51c30508 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs) (revision 08d25a2d4cd349395730ef39d3abf2cc51c30508) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -20,7 +20,10 @@ // All rights reserved. using System; +using System.ComponentModel; +using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.WaveImpactAsphaltCover.Data; @@ -53,5 +56,21 @@ SectionResult.AssessmentLayerTwoA = value; } } + + /// + /// Gets or sets the value representing the result of the layer 3 assessment. + /// + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble AssessmentLayerThree + { + get + { + return SectionResult.AssessmentLayerThree; + } + set + { + SectionResult.AssessmentLayerThree = value.ToPrecision(SectionResult.AssessmentLayerThree.NumberOfDecimalPlaces); + } + } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/Ringtoets.WaveImpactAsphaltCover.Data.Test.csproj =================================================================== diff -u -r7b7bd75dc1c1327386c9be96b5d480565bb8ecd6 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/Ringtoets.WaveImpactAsphaltCover.Data.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Data.Test.csproj) (revision 7b7bd75dc1c1327386c9be96b5d480565bb8ecd6) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/Ringtoets.WaveImpactAsphaltCover.Data.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Data.Test.csproj) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -75,6 +75,10 @@ {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} Ringtoets.Revetment.Data Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r08d25a2d4cd349395730ef39d3abf2cc51c30508 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 08d25a2d4cd349395730ef39d3abf2cc51c30508) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.WaveImpactAsphaltCover.Data.Test { @@ -32,10 +34,7 @@ public void Constructor_WithParameters_ExpectedValues() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); @@ -44,6 +43,35 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); + Assert.IsNaN(result.AssessmentLayerThree); } + + [Test] + [TestCase(double.NaN)] + [TestCase(double.PositiveInfinity)] + [TestCase(double.NegativeInfinity)] + [TestCase(5)] + [TestCase(0.5)] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue(double newValue) + { + // Setup + FailureMechanismSection section = CreateSection(); + var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); + + // Call + result.AssessmentLayerThree = (RoundedDouble) newValue; + + // Assert + Assert.AreEqual(newValue, result.AssessmentLayerThree, + result.AssessmentLayerThree.GetAccuracy()); + } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r08d25a2d4cd349395730ef39d3abf2cc51c30508 -rb5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs) (revision 08d25a2d4cd349395730ef39d3abf2cc51c30508) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs) (revision b5a3ccef1cfc5e4cbfea0a97a8a9ee8ae5a199e2) @@ -19,9 +19,13 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.TypeConverters; using Ringtoets.Common.Forms.Views; using Ringtoets.WaveImpactAsphaltCover.Data; using Ringtoets.WaveImpactAsphaltCover.Forms.Views; @@ -43,6 +47,8 @@ // Assert Assert.IsInstanceOf>(row); + TestHelper.AssertTypeConverter( + nameof(WaveImpactAsphaltCoverFailureMechanismSectionResultRow.AssessmentLayerThree)); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); } @@ -63,6 +69,23 @@ Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + [Test] + public void AssessmentLayerThree_ValueSet_ReturnExpectedValue() + { + // Setup + var random = new Random(21); + RoundedDouble assessmentLayerThree = random.NextRoundedDouble(); + + var sectionResult = new WaveImpactAsphaltCoverFailureMechanismSectionResult(CreateSection()); + var row = new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(sectionResult); + + // Call + row.AssessmentLayerThree = assessmentLayerThree; + + // Assert + Assert.AreEqual(assessmentLayerThree, sectionResult.AssessmentLayerThree); + } + private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("name", new[]