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