Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResult.cs =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResult.cs (.../ClosingStructuresFailureMechanismSectionResult.cs) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Data/ClosingStructuresFailureMechanismSectionResult.cs (.../ClosingStructuresFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Properties; @@ -40,19 +39,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public ClosingStructuresFailureMechanismSectionResult(FailureMechanismSection section) - : base(section) + public ClosingStructuresFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the value for the detailed assessment of safety per failure mechanism section as a probability. /// /// Thrown when is not in range [0,1]. @@ -71,10 +63,5 @@ 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/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r5b1276bcb70296a150fd4a26fbf8867e6f8aa0f2 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision 5b1276bcb70296a150fd4a26fbf8867e6f8aa0f2) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresFailureMechanismSectionResultRow.cs (.../ClosingStructuresFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,94 +21,41 @@ using System; using System.ComponentModel; -using Core.Common.Base.Data; using Ringtoets.ClosingStructures.Data; -using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; namespace Ringtoets.ClosingStructures.Forms.Views { /// /// Class for displaying as a row in a grid view. /// - public class ClosingStructuresFailureMechanismSectionResultRow + public class ClosingStructuresFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly ClosingStructuresFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The to wrap /// so that it can be displayed as a row. /// Thrown when is null. - public ClosingStructuresFailureMechanismSectionResultRow(ClosingStructuresFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public ClosingStructuresFailureMechanismSectionResultRow(ClosingStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the . + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing the result of the . - /// - public bool AssessmentLayerOne - { - get - { - return sectionResult.AssessmentLayerOne; - } - set - { - sectionResult.AssessmentLayerOne = value; - sectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// /// Thrown when is /// not in the range [0,1]. [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] public double AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } set { - sectionResult.AssessmentLayerTwoA = value; + SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return sectionResult.AssessmentLayerThree; - } - set - { - sectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismSectionResultTest.cs =================================================================== diff -u -r3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismSectionResultTest.cs (.../ClosingStructuresFailureMechanismSectionResultTest.cs) (revision 3fad85f24665fdcfe75cba4e2f9ab30c2ca6a4b6) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismSectionResultTest.cs (.../ClosingStructuresFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -31,52 +31,33 @@ public class ClosingStructuresFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new ClosingStructuresFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new ClosingStructuresFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } [Test] [TestCase(-20)] [TestCase(-1e-6)] [TestCase(1 + 1e-6)] [TestCase(12)] - public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double a) + public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new ClosingStructuresFailureMechanismSectionResult(section); // Call - TestDelegate test = () => result.AssessmentLayerTwoA = a; + TestDelegate test = () => result.AssessmentLayerTwoA = newValue; // Assert var message = Assert.Throws(test).Message; @@ -91,20 +72,25 @@ [TestCase(0.5)] [TestCase(1 - 1e-6)] [TestCase(1)] - public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double a) + public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new ClosingStructuresFailureMechanismSectionResult(section); // Call - result.AssessmentLayerTwoA = a; + result.AssessmentLayerTwoA = newValue; // Assert - Assert.AreEqual(a, result.AssessmentLayerTwoA); + Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r5b1276bcb70296a150fd4a26fbf8867e6f8aa0f2 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs (.../ClosingStructuresFailureMechanismSectionResultRowTest.cs) (revision 5b1276bcb70296a150fd4a26fbf8867e6f8aa0f2) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresFailureMechanismSectionResultRowTest.cs (.../ClosingStructuresFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,17 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; -using Rhino.Mocks; using Ringtoets.ClosingStructures.Data; using Ringtoets.ClosingStructures.Forms.Views; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; namespace Ringtoets.ClosingStructures.Forms.Test.Views @@ -39,75 +36,32 @@ public class ClosingStructuresFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new ClosingStructuresFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new ClosingStructuresFailureMechanismSectionResult(section); // Call var row = new ClosingStructuresFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); + Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); - var result = new ClosingStructuresFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new ClosingStructuresFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] [TestCase(0)] [TestCase(1)] [TestCase(0.5)] [TestCase(1e-6)] public void AssessmentLayerTwoA_ForValidValues_ResultPropertyChanged(double value) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new ClosingStructuresFailureMechanismSectionResult(section); var row = new ClosingStructuresFailureMechanismSectionResultRow(result); @@ -126,7 +80,7 @@ public void AssessmentLayerTwoA_ForInvalidValues_ThrowsArgumentException(double value) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new ClosingStructuresFailureMechanismSectionResult(section); var row = new ClosingStructuresFailureMechanismSectionResultRow(result); @@ -135,27 +89,11 @@ // Assert var message = Assert.Throws(test).Message; - Assert.AreEqual(RingtoetsCommonDataResources.ArbitraryProbabilityFailureMechanismSectionResult_AssessmentLayerTwoA_Value_needs_to_be_between_0_and_1, - message); + Assert.AreEqual( + RingtoetsCommonDataResources.ArbitraryProbabilityFailureMechanismSectionResult_AssessmentLayerTwoA_Value_needs_to_be_between_0_and_1, + message); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new ClosingStructuresFailureMechanismSectionResult(section); - var row = new ClosingStructuresFailureMechanismSectionResultRow(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/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs =================================================================== diff -u -r94b85dc077cddf7535b328b8b3a96a494afac0f6 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision 94b85dc077cddf7535b328b8b3a96a494afac0f6) +++ Ringtoets/Common/src/Ringtoets.Common.Data/FailureMechanism/FailureMechanismSectionResult.cs (.../FailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,6 +21,7 @@ using System; using Core.Common.Base; +using Core.Common.Base.Data; namespace Ringtoets.Common.Data.FailureMechanism { @@ -41,9 +42,20 @@ throw new ArgumentNullException("section"); } Section = section; + AssessmentLayerThree = (RoundedDouble)double.NaN; } /// + /// Gets or sets the state of the assessment layer one. + /// + public bool AssessmentLayerOne { get; set; } + + /// + /// Gets or sets the value of the tailored assessment of safety. + /// + public RoundedDouble AssessmentLayerThree { get; set; } + + /// /// Gets the encapsulated . /// public FailureMechanismSection Section { get; private set; } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rcb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision cb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -107,6 +107,7 @@ + UserControl Fisheye: Tag 41fac7fff0a505c08945108d795dcb877f10b816 refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismSectionResultRow.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs =================================================================== diff -u -r2857b234df4622cdaf80bbc75abc58af36667347 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision 2857b234df4622cdaf80bbc75abc58af36667347) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionResultTest.cs (.../FailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,46 +20,87 @@ // 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 { [TestFixture] public class FailureMechanismSectionResultTest { [Test] + public void Constructor_WithParameters_ExpectedValues() + { + // Setup + FailureMechanismSection section = CreateSection(); + + // Call + var result = new TestFailureMechanismSectionResult(section); + + // Assert + Assert.IsInstanceOf(result); + Assert.IsFalse(result.AssessmentLayerOne); + Assert.IsNaN(result.AssessmentLayerThree); + Assert.AreSame(section, result.Section); + } + + [Test] public void Constructor_WithoutSection_ThrowsArgumentNullException() { // Call - TestDelegate test = () => new SimpleFailureMechanismSectionResult(null); + TestDelegate test = () => new TestFailureMechanismSectionResult(null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("section", paramName); } [Test] - public void Constructor_WithSection_ResultCreatedForSection() + [TestCase(true)] + [TestCase(false)] + public void AssessmentLayerOne_SetNewValue_ReturnsNewValue(bool newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); + var failureMechanismSectionResult = new TestFailureMechanismSectionResult(section); // Call - var result = new SimpleFailureMechanismSectionResult(section); + failureMechanismSectionResult.AssessmentLayerOne = newValue; // Assert - Assert.IsInstanceOf(result); - Assert.AreSame(section, result.Section); + Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerOne); } - private class SimpleFailureMechanismSectionResult : FailureMechanismSectionResult + [Test] + public void AssessmentLayerThree_SetNewValue_ReturnsNewValue() { - public SimpleFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + // Setup + Random random = new Random(21); + double newValue = random.NextDouble(); + 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[] + { + new Point2D(0, 0) + }); + } + + private class TestFailureMechanismSectionResult : FailureMechanismSectionResult + { + public TestFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs =================================================================== diff -u -r2857b234df4622cdaf80bbc75abc58af36667347 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs (.../TestFailureMechanismSectionResultTest.cs) (revision 2857b234df4622cdaf80bbc75abc58af36667347) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestFailureMechanismSectionResultTest.cs (.../TestFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -30,18 +30,18 @@ public class TestFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_SectionNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new TestFailureMechanismSectionResult(null); // Assert - var paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("section", paramName); } [Test] - public void Constructor_WithSection_ResultCreatedForSection() + public void Constructor_WithParameters_ExpectedValues() { // Setup var section = new FailureMechanismSection("Section", new[] Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -rcb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision cb4c5e6cd9a0478a8afe7d653bb7467b3c1a2b4e) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -105,6 +105,7 @@ UserControl + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismSectionResultRowTest.cs (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -0,0 +1,125 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base; +using Core.Common.Base.Data; +using Core.Common.Base.Geometry; +using Core.Common.Utils.Reflection; +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 +{ + [TestFixture] + public class FailureMechanismSectionResultRowTest + { + [Test] + public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new TestFailureMechanismSectionResultRow(null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("sectionResult", paramName); + } + + [Test] + public void Constructor_WithParameters_ExpectedValues() + { + // Setup + FailureMechanismSection section = CreateSection(); + var result = new TestFailureMechanismSectionResult(section); + + // Call + var row = new TestFailureMechanismSectionResultRow(result); + + // Assert + Assert.AreEqual(section.Name, row.Name); + Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); + Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); + Assert.IsTrue(TypeUtils.HasTypeConverter( + r => r.AssessmentLayerThree)); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + FailureMechanismSection section = CreateSection(); + var result = new TestFailureMechanismSectionResult(section); + result.Attach(observer); + + var row = new TestFailureMechanismSectionResultRow(result); + + // Call + row.AssessmentLayerOne = newValue; + + // Assert + Assert.AreEqual(newValue, result.AssessmentLayerOne); + + mocks.VerifyAll(); + } + + [Test] + public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() + { + // Setup + Random 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[] + { + new Point2D(0, 0) + }); + } + } + + public class TestFailureMechanismSectionResultRow : FailureMechanismSectionResultRow + { + public TestFailureMechanismSectionResultRow(TestFailureMechanismSectionResult sectionResult) : base(sectionResult) {} + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs =================================================================== diff -u -r87b3dec8abf9077375a10deb16d508d9cc2711e4 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 87b3dec8abf9077375a10deb16d508d9cc2711e4) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationServiceTest.cs (.../WaveHeightCalculationServiceTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -201,7 +201,6 @@ DesignWaterLevel = new RoundedDouble(2, double.NaN), }; - ReliabilityIndexCalculationOutput output = null; using (new HydraRingCalculatorFactoryConfig()) { var testFactory = (TestHydraRingCalculatorFactory) HydraRingCalculatorFactory.Instance; Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r38600213ce6ca43c1819c81dd95c8ce786650ac3 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision 38600213ce6ca43c1819c81dd95c8ce786650ac3) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.GrassCoverErosionInwards.Data @@ -36,10 +35,7 @@ /// /// The to get the result from. /// Thrown when is null. - public GrassCoverErosionInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public GrassCoverErosionInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// /// Gets the value of assessment layer two a. @@ -57,16 +53,6 @@ } /// - /// Gets or sets the value of assessment layer three. - /// - public RoundedDouble AssessmentLayerThree { get; set; } - - /// - /// Gets or sets the state of the assessment layer one. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the , which is chosen /// to be representative for the whole section. /// Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs =================================================================== diff -u -r5e0253e5d6a341d58a67e47830de4845e8699b0c -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision 5e0253e5d6a341d58a67e47830de4845e8699b0c) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,8 +21,8 @@ using System; using System.ComponentModel; -using Core.Common.Base.Data; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.GrassCoverErosionInwards.Data; namespace Ringtoets.GrassCoverErosionInwards.Forms.Views @@ -31,90 +31,38 @@ /// Container of a , which takes care of the /// representation of properties in a grid. /// - internal class GrassCoverErosionInwardsFailureMechanismSectionResultRow + internal class GrassCoverErosionInwardsFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The that is /// the source of this row. /// Thrown when is /// null. - public GrassCoverErosionInwardsFailureMechanismSectionResultRow(GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public GrassCoverErosionInwardsFailureMechanismSectionResultRow(GrassCoverErosionInwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the failure mechanism section. - /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing whether the section passed the layer 0 assessment. - /// - public bool AssessmentLayerOne - { - get - { - return sectionResult.AssessmentLayerOne; - } - set - { - sectionResult.AssessmentLayerOne = value; - sectionResult.NotifyObservers(); - } - } - - /// /// Gets the value representing the result of the layer 2a assessment. /// [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] public double AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } } /// - /// 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; - } - } - - /// /// Gets the of the wrapped /// . /// /// null if the wrapped section result does not have a calculation /// set. Otherwise the calculation of the wrapped section result is returned. public GrassCoverErosionInwardsCalculation GetSectionResultCalculation() { - return sectionResult.Calculation; + return SectionResult.Calculation; } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,45 +30,25 @@ public class GrassCoverErosionInwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new GrassCoverErosionInwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsNull(result.Calculation); - Assert.IsFalse(result.AssessmentLayerOne); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } [Test] public void Calculation_SetNewValue_GetNewlySetValue() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); @@ -86,10 +65,7 @@ public void AssessmentLayerTwoA_CalculationNull_ReturnNaN() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) { @@ -107,10 +83,7 @@ public void AssessmentLayerTwoA_FailedCalculation_ReturnNaN() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(1.0, 1.0, double.NaN, 1.0, 1.0); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) @@ -132,10 +105,7 @@ public void AssessmentLayerTwoA_SuccessfulCalculation_ReturnProbability() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); double probability = 0.65; var probabilityAssessmentOutput = new ProbabilityAssessmentOutput(1.0, 1.0, probability, 1.0, 1.0); @@ -153,5 +123,13 @@ // Assert Assert.AreEqual(probability, twoAValue); } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,18 +19,14 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; -using Rhino.Mocks; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Probability; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.GrassCoverErosionInwards.Forms.Views; @@ -40,70 +36,28 @@ public class GrassCoverErosionInwardsFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new GrassCoverErosionInwardsFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); // Call var row = new GrassCoverErosionInwardsFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - + Assert.IsInstanceOf>(row); + Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSimpleFailureMechanismSection(); - var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new GrassCoverErosionInwardsFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] public void AssessmentLayerTwoA_NoCalculationSet_ReturnNaN() { // Setup - FailureMechanismSection section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); // Precondition @@ -131,7 +85,7 @@ calculation.Output = new GrassCoverErosionInwardsOutput(1.1, false, probabilityAssessmentOutput, 0.0); } - FailureMechanismSection section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) { Calculation = calculation @@ -156,7 +110,7 @@ Output = new GrassCoverErosionInwardsOutput(0.5, true, probabilityAssessmentOutput, 0.0) }; - FailureMechanismSection section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var sectionResult = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) { Calculation = calculation @@ -172,27 +126,10 @@ } [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSimpleFailureMechanismSection(); - var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); - var row = new GrassCoverErosionInwardsFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); - } - - [Test] public void GetSectionResultCalculation_NoCalculationSetOnSectionResult_ReturnNull() { // Setup - var section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section); // Precondition @@ -213,7 +150,7 @@ // Setup var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); - var section = CreateSimpleFailureMechanismSection(); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section) { Calculation = grassCoverErosionInwardsCalculation @@ -228,12 +165,11 @@ Assert.AreSame(grassCoverErosionInwardsCalculation, calculation); } - private static FailureMechanismSection CreateSimpleFailureMechanismSection() + private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("A", new[] { - new Point2D(1.1, 2.2), - new Point2D(3.3, 4.4) + new Point2D(0, 0) }); } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.GrassCoverErosionOutwards.Data @@ -37,25 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public GrassCoverErosionOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public GrassCoverErosionOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// 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 -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,92 +20,38 @@ // 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; namespace Ringtoets.GrassCoverErosionOutwards.Forms.Views { /// /// Class for displaying as a row in a grid view. /// - internal class GrassCoverErosionOutwardsFailureMechanismSectionResultRow + internal class GrassCoverErosionOutwardsFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The to wrap /// so that it can be displayed as a row. /// Thrown when is null. - public GrassCoverErosionOutwardsFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public GrassCoverErosionOutwardsFailureMechanismSectionResultRow(GrassCoverErosionOutwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the failure mechanism section. - /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - //// Gets or sets the value representing whether the section passed the layer 0 assessment. - /// - public bool AssessmentLayerOne - { - get - { - return sectionResult.AssessmentLayerOne; - } - set - { - sectionResult.AssessmentLayerOne = value; - sectionResult.NotifyObservers(); - } - } - - /// /// Gets or sets the value representing the result of the layer 2a assessment. /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } set { - sectionResult.AssessmentLayerTwoA = value; + 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; - } - } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -30,17 +29,6 @@ public class GrassCoverErosionOutwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() - { - // Call - TestDelegate test = () => new GrassCoverErosionOutwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] public void Constructor_WithSection_ResultCreatedForSection() { // Setup @@ -54,10 +42,7 @@ // Assert Assert.IsInstanceOf(result); - Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Views/GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,16 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; -using Core.Common.Utils.Reflection; 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; using Ringtoets.GrassCoverErosionOutwards.Data; using Ringtoets.GrassCoverErosionOutwards.Forms.Views; @@ -38,68 +32,26 @@ public class GrassCoverErosionOutwardsFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); // Call var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); + Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - - Assert.IsTrue(TypeUtils.HasTypeConverter(r => r.AssessmentLayerThree)); } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); - var result = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup var newValue = AssessmentLayerTwoAResult.Successful; - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(result); @@ -110,23 +62,6 @@ Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new GrassCoverErosionOutwardsFailureMechanismSectionResult(section); - var row = new GrassCoverErosionOutwardsFailureMechanismSectionResultRow(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/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionResult.cs =================================================================== diff -u -r38600213ce6ca43c1819c81dd95c8ce786650ac3 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionResult.cs (.../HeightStructuresFailureMechanismSectionResult.cs) (revision 38600213ce6ca43c1819c81dd95c8ce786650ac3) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionResult.cs (.../HeightStructuresFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.HeightStructures.Data @@ -41,7 +40,6 @@ public HeightStructuresFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { assessmentLayerTwoA = double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// @@ -56,16 +54,6 @@ } /// - /// Gets or sets the value of assessment layer three. - /// - public RoundedDouble AssessmentLayerThree { get; set; } - - /// - /// Gets or sets the state of the assessment layer one. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the , which is chosen /// to be representative for the whole section. /// Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,87 +21,34 @@ 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.HeightStructures.Data; namespace Ringtoets.HeightStructures.Forms.Views { /// /// This class represents a row of . /// - internal class HeightStructuresFailureMechanismSectionResultRow + internal class HeightStructuresFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly HeightStructuresFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The this row contains. /// Thrown when is null. - public HeightStructuresFailureMechanismSectionResultRow(HeightStructuresFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public HeightStructuresFailureMechanismSectionResultRow(HeightStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the . + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - /// Gets or sets the assessment layer one of the . - /// - public bool AssessmentLayerOne - { - get - { - return sectionResult.AssessmentLayerOne; - } - set - { - sectionResult.AssessmentLayerOne = value; - sectionResult.NotifyObservers(); - } - } - - /// - /// Gets the assessment layer two a of the . - /// [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] public double AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } } - - /// - /// Gets or sets the assessment layer three of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return sectionResult.AssessmentLayerThree; - } - set - { - sectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionResultTest.cs (.../HeightStructuresFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionResultTest.cs (.../HeightStructuresFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,8 +19,6 @@ // 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 NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,74 +29,21 @@ public class HeightStructuresFailureMechanismSectionResultTest { [Test] - public void Constructor_DefaultValues() + public void Constructor_WithParameters_ExpectedValues() { // Setup - FailureMechanismSection section = CreateSection(); + FailureMechanismSection section = new FailureMechanismSection("test", new[] + { + new Point2D(0, 0) + }); // Call - HeightStructuresFailureMechanismSectionResult sectionResult = new HeightStructuresFailureMechanismSectionResult(section); + var sectionResult = new HeightStructuresFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(sectionResult); Assert.AreSame(section, sectionResult.Section); - Assert.IsFalse(sectionResult.AssessmentLayerOne); Assert.IsNaN(sectionResult.AssessmentLayerTwoA); - Assert.IsNaN(sectionResult.AssessmentLayerThree); } - - [Test] - public void Constructor_SectionNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => new HeightStructuresFailureMechanismSectionResult(null); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("section", exception.ParamName); - } - - [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_Always_ReturnsSetValue(bool newValue) - { - // Setup - FailureMechanismSection section = CreateSection(); - var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section); - - // Call - failureMechanismSectionResult.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerOne); - } - - [Test] - [TestCase(2.3)] - [TestCase(24.6)] - public void AssessmentLayerThree_Always_ReturnsSetValue(double newValue) - { - // Setup - FailureMechanismSection section = CreateSection(); - var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section); - - RoundedDouble assessmentLayerThree = (RoundedDouble) newValue; - - // Call - failureMechanismSectionResult.AssessmentLayerThree = assessmentLayerThree; - - // Assert - Assert.AreEqual(assessmentLayerThree, failureMechanismSectionResult.AssessmentLayerThree); - } - - private static FailureMechanismSection CreateSection() - { - return new FailureMechanismSection("test", new[] - { - new Point2D(1, 2), - new Point2D(3, 4) - }); - } } } \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,16 +19,12 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; -using Core.Common.Base; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; 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; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.Views; @@ -38,89 +34,24 @@ public class HeightStructuresFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new HeightStructuresFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + var section = new FailureMechanismSection("name", new[] + { + new Point2D(0, 0) + }); var result = new HeightStructuresFailureMechanismSectionResult(section); // Call var row = new HeightStructuresFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); + Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } - - [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); - var result = new HeightStructuresFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new HeightStructuresFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new HeightStructuresFailureMechanismSectionResult(section); - var row = new HeightStructuresFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); - } - - private static FailureMechanismSection CreateSection() - { - return new FailureMechanismSection("name", new[] - { - new Point2D(0, 0) - }); - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResult.cs (.../DuneErosionFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResult.cs (.../DuneErosionFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,20 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public DuneErosionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public DuneErosionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// /// 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/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,25 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public GrassCoverSlipOffInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public GrassCoverSlipOffInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// 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 -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,25 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public GrassCoverSlipOffOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public GrassCoverSlipOffOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// 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/MacrostabilityInwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityInwardsFailureMechanismSectionResult.cs (.../MacrostabilityInwardsFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityInwardsFailureMechanismSectionResult.cs (.../MacrostabilityInwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Properties; @@ -40,19 +39,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public MacrostabilityInwardsFailureMechanismSectionResult(FailureMechanismSection section) - : base(section) + public MacrostabilityInwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the value for the detailed assessment of safety per failure mechanism section as a probability. /// /// Thrown when is not in range [0,1]. @@ -71,10 +63,5 @@ 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/MacrostabilityOutwardsFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResult.cs (.../MacrostabilityOutwardsFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResult.cs (.../MacrostabilityOutwardsFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Properties; @@ -40,19 +39,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public MacrostabilityOutwardsFailureMechanismSectionResult(FailureMechanismSection section) - : base(section) + public MacrostabilityOutwardsFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the value for the detailed assessment of safety per failure mechanism section as a probability. /// /// Thrown when is not in range [0,1]. @@ -71,10 +63,5 @@ 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 -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (.../MicrostabilityFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResult.cs (.../MicrostabilityFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,25 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public MicrostabilityFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public MicrostabilityFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// 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 -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (.../PipingStructureFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResult.cs (.../PipingStructureFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,25 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public PipingStructureFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public PipingStructureFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// 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 -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,19 +36,6 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } - - /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// - /// Gets or sets the value of the tailored assessment of safety. - /// - public RoundedDouble AssessmentLayerThree { get; set; } + public StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResult.cs (.../TechnicalInnovationFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,19 +36,6 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } - - /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// - /// Gets or sets the value of the tailored assessment of safety. - /// - public RoundedDouble AssessmentLayerThree { get; set; } + public TechnicalInnovationFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResult.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Integration.Data.StandAlone.SectionResults @@ -37,19 +36,6 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public WaterPressureAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } - - /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// - /// Gets or sets the value of the tailored assessment of safety. - /// - public RoundedDouble AssessmentLayerThree { get; set; } + public WaterPressureAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -97,7 +97,6 @@ DesignWaterLevelLocationsView.cs - Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/DuneErosionSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/DuneErosionSectionResultRow.cs (.../DuneErosionSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/DuneErosionSectionResultRow.cs (.../DuneErosionSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -42,7 +40,7 @@ public DuneErosionSectionResultRow(DuneErosionFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { @@ -55,21 +53,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Fisheye: Tag 673e35de0df920529e5dda63ea8b4dfb08ed65a8 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/FailureMechanismSectionResultRow.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRow.cs (.../GrassCoverSlipOffInwardsSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -42,24 +40,8 @@ public GrassCoverSlipOffInwardsSectionResultRow(GrassCoverSlipOffInwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get @@ -71,21 +53,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs (.../GrassCoverSlipOffOutwardsSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRow.cs (.../GrassCoverSlipOffOutwardsSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -42,24 +40,8 @@ public GrassCoverSlipOffOutwardsSectionResultRow(GrassCoverSlipOffOutwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get @@ -71,21 +53,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityInwardsSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityInwardsSectionResultRow.cs (.../MacrostabilityInwardsSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityInwardsSectionResultRow.cs (.../MacrostabilityInwardsSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,8 +21,8 @@ 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -41,24 +41,8 @@ public MacrostabilityInwardsSectionResultRow(MacrostabilityInwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// /// Thrown when is /// not in the range [0,1]. [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] @@ -73,21 +57,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs (.../MacrostabilityOutwardsSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRow.cs (.../MacrostabilityOutwardsSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,8 +21,8 @@ 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -41,24 +41,8 @@ public MacrostabilityOutwardsSectionResultRow(MacrostabilityOutwardsFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// /// Thrown when is /// not in the range [0,1]. [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] @@ -73,21 +57,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs (.../MicrostabilitySectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/MicrostabilitySectionResultRow.cs (.../MicrostabilitySectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -43,24 +41,8 @@ public MicrostabilitySectionResultRow(MicrostabilityFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get @@ -72,21 +54,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs (.../PipingStructureSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/PipingStructureSectionResultRow.cs (.../PipingStructureSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -42,24 +40,8 @@ public PipingStructureSectionResultRow(PipingStructureFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets or sets the value representing the result of the . + /// Gets the assessment layer two a of the . /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get @@ -71,21 +53,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRow.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,9 +20,7 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -39,37 +37,5 @@ /// 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 . - /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/TechnicalInnovationSectionResultRow.cs (.../TechnicalInnovationSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,9 +20,7 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -39,37 +37,5 @@ /// 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 . - /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the .. - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRow.cs (.../WaterPressureAsphaltCoverSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,9 +20,7 @@ // 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; namespace Ringtoets.Integration.Forms.Views.SectionResultRows @@ -39,37 +37,5 @@ /// 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 . - /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/DuneErosionResultView.cs =================================================================== diff -u -r9a196c8bc554a2e97ff094d7ffb2e99c42eb04fd -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/DuneErosionResultView.cs (.../DuneErosionResultView.cs) (revision 9a196c8bc554a2e97ff094d7ffb2e99c42eb04fd) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/SectionResultViews/DuneErosionResultView.cs (.../DuneErosionResultView.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,6 +21,7 @@ using System; using System.Linq; +using System.Windows.Forms; using Core.Common.Utils; using Core.Common.Utils.Reflection; using Ringtoets.Common.Data.FailureMechanism; @@ -41,6 +42,7 @@ /// public DuneErosionResultView() { + DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); AddDataGridColumns(); } @@ -61,6 +63,9 @@ TypeUtils.GetMemberName(sr => sr.Name), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Section_name, true); + DataGridViewControl.AddCheckBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerOne), + RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one); DataGridViewControl.AddComboBoxColumn( TypeUtils.GetMemberName(sr => sr.AssessmentLayerTwoA), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, @@ -71,5 +76,27 @@ TypeUtils.GetMemberName(sr => sr.AssessmentLayerThree), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three); } + + protected override void Dispose(bool disposing) + { + DataGridViewControl.RemoveCellFormattingHandler(DisableIrrelevantFieldsFormatting); + + base.Dispose(disposing); + } + + private void DisableIrrelevantFieldsFormatting(object sender, DataGridViewCellFormattingEventArgs eventArgs) + { + if (eventArgs.ColumnIndex > 1) + { + if (HasPassedLevelOne(eventArgs.RowIndex)) + { + DataGridViewControl.DisableCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + else + { + DataGridViewControl.RestoreCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + } + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResultTest.cs (.../DuneErosionFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/DuneErosionFailureMechanismSectionResultTest.cs (.../DuneErosionFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class DuneErosionFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new DuneErosionFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -57,7 +45,6 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffInwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class GrassCoverSlipOffInwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new GrassCoverSlipOffInwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,9 +44,7 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs (.../GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class GrassCoverSlipOffOutwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,9 +44,7 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityInwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityInwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityInwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityInwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityInwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -32,52 +32,33 @@ public class MacrostabilityInwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new MacrostabilityInwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new MacrostabilityInwardsFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } [Test] [TestCase(-20)] [TestCase(-1e-6)] [TestCase(1 + 1e-6)] [TestCase(12)] - public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double a) + public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new MacrostabilityInwardsFailureMechanismSectionResult(section); // Call - TestDelegate test = () => result.AssessmentLayerTwoA = a; + TestDelegate test = () => result.AssessmentLayerTwoA = newValue; // Assert var message = Assert.Throws(test).Message; @@ -92,20 +73,25 @@ [TestCase(0.5)] [TestCase(1 - 1e-6)] [TestCase(1)] - public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double a) + public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new MacrostabilityInwardsFailureMechanismSectionResult(section); // Call - result.AssessmentLayerTwoA = a; + result.AssessmentLayerTwoA = newValue; // Assert - Assert.AreEqual(a, result.AssessmentLayerTwoA); + Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + + 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/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MacrostabilityOutwardsFailureMechanismSectionResultTest.cs (.../MacrostabilityOutwardsFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -32,52 +32,33 @@ public class MacrostabilityOutwardsFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new MacrostabilityOutwardsFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new MacrostabilityOutwardsFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } [Test] [TestCase(-20)] [TestCase(-1e-6)] [TestCase(1 + 1e-6)] [TestCase(12)] - public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double a) + public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new MacrostabilityOutwardsFailureMechanismSectionResult(section); // Call - TestDelegate test = () => result.AssessmentLayerTwoA = a; + TestDelegate test = () => result.AssessmentLayerTwoA = newValue; // Assert var message = Assert.Throws(test).Message; @@ -92,20 +73,25 @@ [TestCase(0.5)] [TestCase(1 - 1e-6)] [TestCase(1)] - public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double a) + public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new MacrostabilityOutwardsFailureMechanismSectionResult(section); // Call - result.AssessmentLayerTwoA = a; + result.AssessmentLayerTwoA = newValue; // Assert - Assert.AreEqual(a, result.AssessmentLayerTwoA); + Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + + 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/MicrostabilityFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResultTest.cs (.../MicrostabilityFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/MicrostabilityFailureMechanismSectionResultTest.cs (.../MicrostabilityFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class MicrostabilityFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new MicrostabilityFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,9 +44,7 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs (.../PipingStructureFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/PipingStructureFailureMechanismSectionResultTest.cs (.../PipingStructureFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class PipingStructureFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new PipingStructureFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,9 +44,7 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs (.../StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -31,19 +31,8 @@ public class StrengthStabilityLengthwiseConstructionFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,8 +45,6 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/TechnicalInnovationFailureMechanismSectionResultTest.cs (.../TechnicalInnovationFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class TechnicalInnovationFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new TechnicalInnovationFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,8 +44,6 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/StandAlone/SectionResults/WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaterPressureAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,19 +30,8 @@ public class WaterPressureAsphaltCoverFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new WaterPressureAsphaltCoverFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,8 +44,6 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r6ddf92411860d3f692da3018e1662e633003e0a9 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 6ddf92411860d3f692da3018e1662e633003e0a9) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -124,7 +124,6 @@ - Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/DuneErosionSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/DuneErosionSectionResultRowTest.cs (.../DuneErosionSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/DuneErosionSectionResultRowTest.cs (.../DuneErosionSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -27,6 +27,7 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -36,14 +37,17 @@ public class DuneErosionSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new DuneErosionFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new DuneErosionSectionResultRow(null); + var row = new DuneErosionSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -57,7 +61,6 @@ var row = new DuneErosionSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); Fisheye: Tag 673e35de0df920529e5dda63ea8b4dfb08ed65a8 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/FailureMechanismSectionResultRowTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRowTest.cs (.../GrassCoverSlipOffInwardsSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffInwardsSectionResultRowTest.cs (.../GrassCoverSlipOffInwardsSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class GrassCoverSlipOffInwardsSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new GrassCoverSlipOffInwardsSectionResultRow(null); + var row = new GrassCoverSlipOffInwardsSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new GrassCoverSlipOffInwardsSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -69,31 +70,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new GrassCoverSlipOffInwardsFailureMechanismSectionResult(section); - var row = new GrassCoverSlipOffInwardsSectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRowTest.cs (.../GrassCoverSlipOffOutwardsSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/GrassCoverSlipOffOutwardsSectionResultRowTest.cs (.../GrassCoverSlipOffOutwardsSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class GrassCoverSlipOffOutwardsSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new GrassCoverSlipOffOutwardsSectionResultRow(null); + var row = new GrassCoverSlipOffOutwardsSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new GrassCoverSlipOffOutwardsSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -69,31 +70,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new GrassCoverSlipOffOutwardsFailureMechanismSectionResult(section); - var row = new GrassCoverSlipOffOutwardsSectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityInwardsSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityInwardsSectionResultRowTest.cs (.../MacrostabilityInwardsSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityInwardsSectionResultRowTest.cs (.../MacrostabilityInwardsSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,15 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; 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; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; @@ -40,14 +39,17 @@ public class MacrostabilityInwardsSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new MacrostabilityInwardsFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new MacrostabilityInwardsSectionResultRow(null); + var row = new MacrostabilityInwardsSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -61,8 +63,6 @@ var row = new MacrostabilityInwardsSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -75,32 +75,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); - var result = new MacrostabilityInwardsFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new MacrostabilityInwardsSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] [TestCase(0)] [TestCase(1)] [TestCase(0.5)] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRowTest.cs (.../MacrostabilityOutwardsSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MacrostabilityOutwardsSectionResultRowTest.cs (.../MacrostabilityOutwardsSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; @@ -39,14 +39,17 @@ public class MacrostabilityOutwardsSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new MacrostabilityOutwardsFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new MacrostabilityOutwardsSectionResultRow(null); + var row = new MacrostabilityOutwardsSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -60,8 +63,6 @@ var row = new MacrostabilityOutwardsSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -74,31 +75,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new MacrostabilityOutwardsFailureMechanismSectionResult(section); - var row = new MacrostabilityOutwardsSectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] [TestCase(0)] [TestCase(1)] [TestCase(0.5)] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MicrostabilitySectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MicrostabilitySectionResultRowTest.cs (.../MicrostabilitySectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/MicrostabilitySectionResultRowTest.cs (.../MicrostabilitySectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class MicrostabilitySectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new MicrostabilityFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new MicrostabilitySectionResultRow(null); + var row = new MicrostabilitySectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new MicrostabilitySectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -69,31 +70,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new MicrostabilityFailureMechanismSectionResult(section); - var row = new MicrostabilitySectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/PipingStructureSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/PipingStructureSectionResultRowTest.cs (.../PipingStructureSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/PipingStructureSectionResultRowTest.cs (.../PipingStructureSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class PipingStructureSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new PipingStructureFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new PipingStructureSectionResultRow(null); + var row = new PipingStructureSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new PipingStructureSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); @@ -69,31 +70,6 @@ } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new PipingStructureFailureMechanismSectionResult(section); - var row = new PipingStructureSectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class StrengthStabilityLengthwiseConstructionSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new StrengthStabilityLengthwiseConstructionSectionResultRow(null); + var row = new StrengthStabilityLengthwiseConstructionSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new StrengthStabilityLengthwiseConstructionSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); Assert.IsTrue(TypeUtils.HasTypeConverter counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs (.../TechnicalInnovationSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/TechnicalInnovationSectionResultRowTest.cs (.../TechnicalInnovationSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,15 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; 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; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -38,14 +37,17 @@ public class TechnicalInnovationSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new TechnicalInnovationFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new TechnicalInnovationSectionResultRow(null); + var row = new TechnicalInnovationSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -59,8 +61,6 @@ var row = new TechnicalInnovationSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); Assert.IsTrue(TypeUtils.HasTypeConverter(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); - var result = new TechnicalInnovationFailureMechanismSectionResult(section); - result.Attach(observer); - - var row = new TechnicalInnovationSectionResultRow(result); - - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); - } - - [Test] public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs (.../WaterPressureAsphaltCoverSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultRows/WaterPressureAsphaltCoverSectionResultRowTest.cs (.../WaterPressureAsphaltCoverSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Integration.Data.StandAlone.SectionResults; using Ringtoets.Integration.Forms.Views.SectionResultRows; @@ -37,14 +37,17 @@ public class WaterPressureAsphaltCoverSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new WaterPressureAsphaltCoverFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new WaterPressureAsphaltCoverSectionResultRow(null); + var row = new WaterPressureAsphaltCoverSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -58,8 +61,6 @@ var row = new WaterPressureAsphaltCoverSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); Assert.IsTrue(TypeUtils.HasTypeConverter counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/DuneErosionResultViewTest.cs =================================================================== diff -u -r2973c5f790a5131e427bd5f73e2a620044199639 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/DuneErosionResultViewTest.cs (.../DuneErosionResultViewTest.cs) (revision 2973c5f790a5131e427bd5f73e2a620044199639) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/SectionResultViews/DuneErosionResultViewTest.cs (.../DuneErosionResultViewTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -37,8 +37,9 @@ public class DuneErosionResultViewTest { private const int nameColumnIndex = 0; - private const int assessmentLayerTwoAIndex = 1; - private const int assessmentLayerThreeIndex = 2; + private const int assessmentLayerOneIndex = 1; + private const int assessmentLayerTwoAIndex = 2; + private const int assessmentLayerThreeIndex = 3; [Test] public void GivenFormWithDuneErosionFailureMechanismResultView_WhenShown_ThenExpectedColumnsAreVisible() @@ -55,11 +56,13 @@ // Then var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - Assert.AreEqual(3, dataGridView.ColumnCount); + Assert.AreEqual(4, dataGridView.ColumnCount); + Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerOneIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerTwoAIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); + Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one, dataGridView.Columns[assessmentLayerOneIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, dataGridView.Columns[assessmentLayerTwoAIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three, dataGridView.Columns[assessmentLayerThreeIndex].HeaderText); @@ -83,11 +86,13 @@ Random random = new Random(21); var result1 = new DuneErosionFailureMechanismSectionResult(section1) { + AssessmentLayerOne = true, AssessmentLayerTwoA = AssessmentLayerTwoAResult.Failed, AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; var result2 = new DuneErosionFailureMechanismSectionResult(section2) { + AssessmentLayerOne = true, AssessmentLayerTwoA = AssessmentLayerTwoAResult.Successful, AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; @@ -112,14 +117,16 @@ Assert.AreEqual(2, rows.Count); var cells = rows[0].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((bool)cells[assessmentLayerOneIndex].Value); Assert.AreEqual(result1.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); Assert.AreEqual(result1.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); cells = rows[1].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((bool) cells[assessmentLayerOneIndex].Value); Assert.AreEqual(result2.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); Assert.AreEqual(result2.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingFailureMechanismSectionResult.cs (.../PipingFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.Piping.Data @@ -36,19 +35,6 @@ /// /// The to get the result from. /// Thrown when is null. - public PipingFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } - - /// - /// Gets or sets the value of assessment layer three. - /// - public RoundedDouble AssessmentLayerThree { get; set; } - - /// - /// Gets or sets the state of the assessment layer one. - /// - public bool AssessmentLayerOne { get; set; } + public PipingFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs =================================================================== diff -u -r06abcaadc2936c0bf3fde73916c051f37f698505 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision 06abcaadc2936c0bf3fde73916c051f37f698505) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismResultView.cs (.../PipingFailureMechanismResultView.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -134,18 +134,17 @@ private void ShowAssementLayerTwoAErrors(object sender, DataGridViewCellFormattingEventArgs e) { - if (e.ColumnIndex <= 0) + if (e.ColumnIndex != assessmentLayerTwoAIndex) { return; } - var currentDataGridViewCell = DataGridViewControl.GetCell(e.RowIndex, e.ColumnIndex); + DataGridViewCell currentDataGridViewCell = DataGridViewControl.GetCell(e.RowIndex, e.ColumnIndex); var resultRow = (PipingFailureMechanismSectionResultRow) GetDataAtRow(e.RowIndex); - - if (resultRow != null && e.ColumnIndex == assessmentLayerTwoAIndex) + if (resultRow != null) { - PipingFailureMechanismSectionResult rowObject = resultRow.SectionResult; + PipingFailureMechanismSectionResult rowObject = resultRow.GetSectionResult; var relevantScenarios = rowObject.GetCalculationScenarios(FailureMechanism.Calculations.OfType()).Where(cs => cs.IsRelevant).ToArray(); bool relevantScenarioAvailable = relevantScenarios.Length != 0; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingFailureMechanismSectionResultRow.cs (.../PipingFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -23,9 +23,9 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; -using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Piping.Data; using CommonBaseResources = Core.Common.Base.Properties.Resources; @@ -35,7 +35,7 @@ /// Container of a , which takes care of the /// representation of properties in a grid. /// - internal class PipingFailureMechanismSectionResultRow + internal class PipingFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { private const double tolerance = 1e-6; private readonly IEnumerable calculations; @@ -46,48 +46,19 @@ /// The that is /// the source of this row. /// - /// Throw when is - /// null. - public PipingFailureMechanismSectionResultRow(PipingFailureMechanismSectionResult sectionResult, IEnumerable calculations) + /// Throw when any parameter is null. + public PipingFailureMechanismSectionResultRow(PipingFailureMechanismSectionResult sectionResult, IEnumerable calculations) : base(sectionResult) { - if (sectionResult == null) + if (calculations == null) { - throw new ArgumentNullException("sectionResult"); + throw new ArgumentNullException("calculations"); } - SectionResult = sectionResult; this.calculations = calculations; } /// - /// Gets the name of the failure mechanism section. + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return SectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing whether the section passed the layer 0 assessment. - /// - public bool AssessmentLayerOne - { - get - { - return SectionResult.AssessmentLayerOne; - } - set - { - SectionResult.AssessmentLayerOne = value; - SectionResult.NotifyObservers(); - } - } - - /// - /// Gets the value representing the result of the layer 2a assessment. - /// [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] public double AssessmentLayerTwoA { @@ -111,21 +82,14 @@ } /// - /// Gets or sets the value representing the result of the layer 3 assessment. + /// Gets the that is the source of this row. /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree + public PipingFailureMechanismSectionResult GetSectionResult { get { - return SectionResult.AssessmentLayerThree; + return SectionResult; } - set - { - SectionResult.AssessmentLayerThree = value; - } } - - public PipingFailureMechanismSectionResult SectionResult { get; private set; } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs (.../PipingFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismSectionResultTest.cs (.../PipingFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,8 +19,6 @@ // 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 NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -31,71 +29,21 @@ public class PipingFailureMechanismSectionResultTest { [Test] - public void Constructor_DefaultValues() + public void Constructor_WithParameters_ExpectedValues() { // Setup - FailureMechanismSection section = CreateSection(); + var section = new FailureMechanismSection("test", new[] + { + new Point2D(0, 0) + }); // Call - PipingFailureMechanismSectionResult sectionResult = new PipingFailureMechanismSectionResult(section); + var sectionResult = new PipingFailureMechanismSectionResult(section); // Assert Assert.IsInstanceOf(sectionResult); Assert.AreSame(section, sectionResult.Section); - Assert.IsFalse(sectionResult.AssessmentLayerOne); Assert.IsNaN(sectionResult.GetAssessmentLayerTwoA(new PipingCalculationScenario[0])); - Assert.IsNaN(sectionResult.AssessmentLayerThree); } - - [Test] - public void Constructor_SectionNull_ThrowsArgumentNullException() - { - // Call - TestDelegate call = () => new PipingFailureMechanismSectionResult(null); - - // Assert - var exception = Assert.Throws(call); - Assert.AreEqual("section", exception.ParamName); - } - - [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_Always_ReturnsSetValue(bool newValue) - { - // Setup - FailureMechanismSection section = CreateSection(); - var failureMechanismSectionResult = new PipingFailureMechanismSectionResult(section); - - // Call - failureMechanismSectionResult.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(newValue, failureMechanismSectionResult.AssessmentLayerOne); - } - - [Test] - public void AssessmentLayerThree_Always_ReturnsSetValue() - { - // Setup - FailureMechanismSection section = CreateSection(); - var failureMechanismSectionResult = new PipingFailureMechanismSectionResult(section); - var assessmentLayerThreeValue = (RoundedDouble) 3.0; - - // Call - failureMechanismSectionResult.AssessmentLayerThree = assessmentLayerThreeValue; - - // Assert - Assert.AreEqual(assessmentLayerThreeValue, failureMechanismSectionResult.AssessmentLayerThree); - } - - private static FailureMechanismSection CreateSection() - { - return new FailureMechanismSection("test", new[] - { - new Point2D(1, 2), - new Point2D(3, 4) - }); - } } } \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs (.../PipingFailureMechanismSectionResultRowTest.cs) (revision 5bdb5ecc12d8c8e7ef49b63f0a40dfbdd2532d54) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingFailureMechanismSectionResultRowTest.cs (.../PipingFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,16 +21,14 @@ using System; using System.Linq; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; -using Rhino.Mocks; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.Piping.Data; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.Forms.Views; @@ -42,70 +40,43 @@ public class PipingFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new PipingFailureMechanismSectionResultRow(null, null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new PipingFailureMechanismSectionResult(section); // Call - var row = new PipingFailureMechanismSectionResultRow(result, null); + var row = new PipingFailureMechanismSectionResultRow(result, Enumerable.Empty()); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - + Assert.IsInstanceOf>(row); + Assert.AreEqual(result.GetAssessmentLayerTwoA(Enumerable.Empty()), row.AssessmentLayerTwoA); Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) + public void Constructor_CalculationsNull_ThrowsArgumentNullException() { // Setup - var mocks = new MockRepository(); - var observer = mocks.StrictMock(); - observer.Expect(o => o.UpdateObserver()); - mocks.ReplayAll(); - - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new PipingFailureMechanismSectionResult(section); - result.Attach(observer); - var row = new PipingFailureMechanismSectionResultRow(result, null); - // Call - row.AssessmentLayerOne = newValue; + TestDelegate test = () => new PipingFailureMechanismSectionResultRow(result, null); // Assert - Assert.AreEqual(newValue, result.AssessmentLayerOne); - - mocks.VerifyAll(); + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("calculations", paramName); } [Test] public void AssessmentLayerTwoA_NoScenarios_ReturnNaN() { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new PipingFailureMechanismSectionResult(section); // Call @@ -124,7 +95,7 @@ public void AssessmentLayerTwoA_RelevantScenarioContributionDontAddUpTo1_ReturnNaN(double contributionA, double contributionB) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var scenarioA = PipingCalculationScenarioFactory.CreateNotCalculatedPipingCalculationScenario(section); var scenarioB = PipingCalculationScenarioFactory.CreateNotCalculatedPipingCalculationScenario(section); @@ -151,7 +122,7 @@ public void AssessmentLayerTwoA_NoRelevantScenariosDone_ReturnNaN(CalculationScenarioStatus status) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var scenario = status.Equals(CalculationScenarioStatus.NotCalculated) ? PipingCalculationScenarioFactory.CreateNotCalculatedPipingCalculationScenario(section) @@ -174,7 +145,7 @@ public void AssessmentLayerTwoA_RelevantScenariosDone_ResultOfSection() { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var scenario = PipingCalculationScenarioFactory.CreatePipingCalculationScenario(0.2, section); scenario.Contribution = (RoundedDouble) 1.0; @@ -195,23 +166,6 @@ Assert.AreEqual(expected, assessmentLayerTwoA, 1e-6); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new PipingFailureMechanismSectionResult(section); - var row = new PipingFailureMechanismSectionResultRow(result, null); - - // 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/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismSectionResult.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismSectionResult.cs (.../StabilityPointStructuresFailureMechanismSectionResult.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructuresFailureMechanismSectionResult.cs (.../StabilityPointStructuresFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Properties; @@ -40,11 +39,9 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public StabilityPointStructuresFailureMechanismSectionResult(FailureMechanismSection section) - : base(section) + public StabilityPointStructuresFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// @@ -66,10 +63,5 @@ 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/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs =================================================================== diff -u -re5f4a598d201934e48ab71795fb3b19cb9a960b1 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision e5f4a598d201934e48ab71795fb3b19cb9a960b1) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismResultView.cs (.../StabilityPointStructuresFailureMechanismResultView.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Windows.Forms; using Core.Common.Utils.Reflection; using Ringtoets.Common.Forms.Views; using Ringtoets.StabilityPointStructures.Data; @@ -36,6 +37,7 @@ /// public StabilityPointStructuresFailureMechanismResultView() { + DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); AddDataGridColumns(); } @@ -44,18 +46,43 @@ return new StabilityPointStructuresFailureMechanismSectionResultRow(sectionResult); } + protected override void Dispose(bool disposing) + { + DataGridViewControl.RemoveCellFormattingHandler(DisableIrrelevantFieldsFormatting); + + base.Dispose(disposing); + } + private void AddDataGridColumns() { DataGridViewControl.AddTextBoxColumn( TypeUtils.GetMemberName(sr => sr.Name), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Section_name, true); + DataGridViewControl.AddCheckBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerOne), + RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one); DataGridViewControl.AddTextBoxColumn( TypeUtils.GetMemberName(sr => sr.AssessmentLayerTwoA), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a); DataGridViewControl.AddTextBoxColumn( TypeUtils.GetMemberName(sr => sr.AssessmentLayerThree), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three); } + + private void DisableIrrelevantFieldsFormatting(object sender, DataGridViewCellFormattingEventArgs eventArgs) + { + if (eventArgs.ColumnIndex > 1) + { + if (HasPassedLevelOne(eventArgs.RowIndex)) + { + DataGridViewControl.DisableCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + else + { + DataGridViewControl.RestoreCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + } + } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -re5f4a598d201934e48ab71795fb3b19cb9a960b1 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision e5f4a598d201934e48ab71795fb3b19cb9a960b1) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,78 +21,41 @@ 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.StabilityPointStructures.Data; namespace Ringtoets.StabilityPointStructures.Forms.Views { /// /// Class for displaying as a row in a grid view. /// - public class StabilityPointStructuresFailureMechanismSectionResultRow + public class StabilityPointStructuresFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly StabilityPointStructuresFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The to wrap /// so that it can be displayed as a row. /// Thrown when is null. - public StabilityPointStructuresFailureMechanismSectionResultRow(StabilityPointStructuresFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public StabilityPointStructuresFailureMechanismSectionResultRow(StabilityPointStructuresFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the . + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing the result of the . - /// /// Thrown when is /// not in the range [0,1]. [TypeConverter(typeof(FailureMechanismSectionResultNoProbabilityValueDoubleConverter))] public double AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } set { - sectionResult.AssessmentLayerTwoA = value; + SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return sectionResult.AssessmentLayerThree; - } - set - { - sectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismSectionResultTest.cs =================================================================== diff -u -rae14c5d4e4624fa87390e6d63bb419c648e12dda -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismSectionResultTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultTest.cs) (revision ae14c5d4e4624fa87390e6d63bb419c648e12dda) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismSectionResultTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -31,24 +31,10 @@ public class StabilityPointStructuresFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() - { - // Call - TestDelegate test = () => new StabilityPointStructuresFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] public void Constructor_WithSection_ResultCreatedForSection() { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); // Call var result = new StabilityPointStructuresFailureMechanismSectionResult(section); @@ -57,25 +43,21 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } [Test] [TestCase(-20)] [TestCase(-1e-6)] [TestCase(1 + 1e-6)] [TestCase(12)] - public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double a) + public void AssessmentLayerTwoA_ForInvalidValues_ThrowsException(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new StabilityPointStructuresFailureMechanismSectionResult(section); // Call - TestDelegate test = () => result.AssessmentLayerTwoA = a; + TestDelegate test = () => result.AssessmentLayerTwoA = newValue; // Assert var message = Assert.Throws(test).Message; @@ -90,20 +72,25 @@ [TestCase(0.5)] [TestCase(1 - 1e-6)] [TestCase(1)] - public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double a) + public void AssessmentLayerTwoA_ForValidValues_NewValueSet(double newValue) { // Setup - var section = new FailureMechanismSection("Section", new[] - { - new Point2D(0, 0) - }); + FailureMechanismSection section = CreateSection(); var result = new StabilityPointStructuresFailureMechanismSectionResult(section); // Call - result.AssessmentLayerTwoA = a; + result.AssessmentLayerTwoA = newValue; // Assert - Assert.AreEqual(a, result.AssessmentLayerTwoA); + Assert.AreEqual(newValue, result.AssessmentLayerTwoA); } + + private static FailureMechanismSection CreateSection() + { + return new FailureMechanismSection("Section", new[] + { + new Point2D(0, 0) + }); + } } } \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs =================================================================== diff -u -re5f4a598d201934e48ab71795fb3b19cb9a960b1 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs (.../StabilityPointStructuresFailureMechanismResultViewTest.cs) (revision e5f4a598d201934e48ab71795fb3b19cb9a960b1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs (.../StabilityPointStructuresFailureMechanismResultViewTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -38,8 +38,9 @@ public class StabilityPointStructuresFailureMechanismResultViewTest { private const int nameColumnIndex = 0; - private const int assessmentLayerTwoAIndex = 1; - private const int assessmentLayerThreeIndex = 2; + private const int assessmentLayerOneIndex = 1; + private const int assessmentLayerTwoAIndex = 2; + private const int assessmentLayerThreeIndex = 3; [Test] public void GivenFormWithStabilityPointStructuresFailureMechanismResultView_ThenExpectedColumnsAreVisible() @@ -54,11 +55,13 @@ // Then var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - Assert.AreEqual(3, dataGridView.ColumnCount); + Assert.AreEqual(4, dataGridView.ColumnCount); + Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerOneIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerTwoAIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); + Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one, dataGridView.Columns[assessmentLayerOneIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, dataGridView.Columns[assessmentLayerTwoAIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three, dataGridView.Columns[assessmentLayerThreeIndex].HeaderText); @@ -82,12 +85,14 @@ Random random = new Random(21); var result1 = new StabilityPointStructuresFailureMechanismSectionResult(section1) { + AssessmentLayerOne = true, AssessmentLayerTwoA = (RoundedDouble) random.NextDouble(), AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; var result2 = new StabilityPointStructuresFailureMechanismSectionResult(section2) { - AssessmentLayerTwoA = (RoundedDouble) random.NextDouble(), + AssessmentLayerOne = true, + AssessmentLayerTwoA = (RoundedDouble)random.NextDouble(), AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; @@ -110,15 +115,17 @@ Assert.AreEqual(2, rows.Count); var cells = rows[0].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((Boolean) cells[assessmentLayerOneIndex].Value); var expectedAssessmentLayer2AString1 = ProbabilityFormattingHelper.Format(result1.AssessmentLayerTwoA); Assert.AreEqual(expectedAssessmentLayer2AString1, cells[assessmentLayerTwoAIndex].FormattedValue); Assert.AreEqual(result1.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); cells = rows[1].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((Boolean)cells[assessmentLayerOneIndex].Value); var expectedAssessmentLayer2AString2 = ProbabilityFormattingHelper.Format(result2.AssessmentLayerTwoA); Assert.AreEqual(expectedAssessmentLayer2AString2, cells[assessmentLayerTwoAIndex].FormattedValue); Assert.AreEqual(result2.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -re5f4a598d201934e48ab71795fb3b19cb9a960b1 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision e5f4a598d201934e48ab71795fb3b19cb9a960b1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,13 +20,12 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; -using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.StabilityPointStructures.Data; using Ringtoets.StabilityPointStructures.Forms.Views; using RingtoetsCommonDataResources = Ringtoets.Common.Data.Properties.Resources; @@ -37,37 +36,21 @@ public class StabilityPointStructuresFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new StabilityPointStructuresFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new StabilityPointStructuresFailureMechanismSectionResult(section); // Call var row = new StabilityPointStructuresFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); + Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } [Test] @@ -78,7 +61,7 @@ public void AssessmentLayerTwoA_ForValidValues_ResultPropertyChanged(double value) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new StabilityPointStructuresFailureMechanismSectionResult(section); var row = new StabilityPointStructuresFailureMechanismSectionResultRow(result); @@ -97,7 +80,7 @@ public void AssessmentLayerTwoA_ForInvalidValues_ThrowsArgumentException(double value) { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new StabilityPointStructuresFailureMechanismSectionResult(section); var row = new StabilityPointStructuresFailureMechanismSectionResultRow(result); @@ -110,23 +93,6 @@ message); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new StabilityPointStructuresFailureMechanismSectionResult(section); - var row = new StabilityPointStructuresFailureMechanismSectionResultRow(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/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs (.../StabilityStoneCoverFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Data/StabilityStoneCoverFailureMechanismSectionResult.cs (.../StabilityStoneCoverFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Core.Common.Base.Data; using Ringtoets.Common.Data.FailureMechanism; namespace Ringtoets.StabilityStoneCover.Data @@ -37,20 +36,12 @@ /// The for which the /// will hold the result. /// Thrown when is null. - public StabilityStoneCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) - { - AssessmentLayerThree = (RoundedDouble) double.NaN; - } + public StabilityStoneCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) {} /// /// 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/StabilityStoneCoverResultView.cs =================================================================== diff -u -r1ff2f27e84cbd5da25a9da66d478467a773cb573 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverResultView.cs (.../StabilityStoneCoverResultView.cs) (revision 1ff2f27e84cbd5da25a9da66d478467a773cb573) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverResultView.cs (.../StabilityStoneCoverResultView.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -21,6 +21,7 @@ using System; using System.Linq; +using System.Windows.Forms; using Core.Common.Utils; using Core.Common.Utils.Reflection; using Ringtoets.Common.Data.FailureMechanism; @@ -40,6 +41,7 @@ /// public StabilityStoneCoverResultView() { + DataGridViewControl.AddCellFormattingHandler(DisableIrrelevantFieldsFormatting); AddDataGridColumns(); } @@ -48,6 +50,13 @@ return new StabilityStoneCoverSectionResultRow(sectionResult); } + protected override void Dispose(bool disposing) + { + DataGridViewControl.RemoveCellFormattingHandler(DisableIrrelevantFieldsFormatting); + + base.Dispose(disposing); + } + private void AddDataGridColumns() { EnumDisplayWrapper[] twoAResultDataSource = @@ -60,6 +69,9 @@ TypeUtils.GetMemberName(sr => sr.Name), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Section_name, true); + DataGridViewControl.AddCheckBoxColumn( + TypeUtils.GetMemberName(sr => sr.AssessmentLayerOne), + RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one); DataGridViewControl.AddComboBoxColumn( TypeUtils.GetMemberName(sr => sr.AssessmentLayerTwoA), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, @@ -70,5 +82,20 @@ TypeUtils.GetMemberName(sr => sr.AssessmentLayerThree), RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three); } + + private void DisableIrrelevantFieldsFormatting(object sender, DataGridViewCellFormattingEventArgs eventArgs) + { + if (eventArgs.ColumnIndex > 1) + { + if (HasPassedLevelOne(eventArgs.RowIndex)) + { + DataGridViewControl.DisableCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + else + { + DataGridViewControl.RestoreCell(eventArgs.RowIndex, eventArgs.ColumnIndex); + } + } + } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs =================================================================== diff -u -r1ff2f27e84cbd5da25a9da66d478467a773cb573 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs (.../StabilityStoneCoverSectionResultRow.cs) (revision 1ff2f27e84cbd5da25a9da66d478467a773cb573) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Views/StabilityStoneCoverSectionResultRow.cs (.../StabilityStoneCoverSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,10 +20,8 @@ // 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; namespace Ringtoets.StabilityStoneCover.Forms.Views @@ -32,37 +30,19 @@ /// Class for displaying /// as a row in a grid view. /// - public class StabilityStoneCoverSectionResultRow + public class StabilityStoneCoverSectionResultRow : FailureMechanismSectionResultRow { /// /// Creates a new instance of . /// /// The /// to wrap so that it can be displayed as a row. /// Thrown when is null. - public StabilityStoneCoverSectionResultRow(StabilityStoneCoverFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - SectionResult = sectionResult; - } + public StabilityStoneCoverSectionResultRow(StabilityStoneCoverFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the failure mechanism section. + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return SectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing the result of the . - /// public AssessmentLayerTwoAResult AssessmentLayerTwoA { get @@ -74,26 +54,5 @@ SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return SectionResult.AssessmentLayerThree; - } - set - { - SectionResult.AssessmentLayerThree = value; - } - } - - /// - /// Gets the that is the source of this row. - /// - private StabilityStoneCoverFailureMechanismSectionResult SectionResult { get; set; } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs (.../StabilityStoneCoverFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismSectionResultTest.cs (.../StabilityStoneCoverFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -30,19 +29,8 @@ public class StabilityStoneCoverFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new StabilityStoneCoverFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -56,7 +44,6 @@ Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); Assert.AreEqual(AssessmentLayerTwoAResult.NotCalculated, result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree.Value); } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverResultViewTest.cs =================================================================== diff -u -r2973c5f790a5131e427bd5f73e2a620044199639 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverResultViewTest.cs (.../StabilityStoneCoverResultViewTest.cs) (revision 2973c5f790a5131e427bd5f73e2a620044199639) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverResultViewTest.cs (.../StabilityStoneCoverResultViewTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -37,8 +37,9 @@ public class StabilityStoneCoverResultViewTest { private const int nameColumnIndex = 0; - private const int assessmentLayerTwoAIndex = 1; - private const int assessmentLayerThreeIndex = 2; + private const int assessmentLayerOneIndex = 1; + private const int assessmentLayerTwoAIndex = 2; + private const int assessmentLayerThreeIndex = 3; [Test] public void GivenFormWithStabilityStoneCoverFailureMechanismResultView_WhenShown_ThenExpectedColumnsAreVisible() @@ -55,11 +56,14 @@ // Then var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - Assert.AreEqual(3, dataGridView.ColumnCount); + Assert.AreEqual(4, dataGridView.ColumnCount); + Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerOneIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerTwoAIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); + Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_one, + dataGridView.Columns[assessmentLayerOneIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_two_a, dataGridView.Columns[assessmentLayerTwoAIndex].HeaderText); Assert.AreEqual(RingtoetsCommonFormsResources.FailureMechanismResultView_InitializeDataGridView_Assessment_layer_three, @@ -85,11 +89,13 @@ Random random = new Random(21); var result1 = new StabilityStoneCoverFailureMechanismSectionResult(section1) { + AssessmentLayerOne = true, AssessmentLayerTwoA = AssessmentLayerTwoAResult.Failed, AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; var result2 = new StabilityStoneCoverFailureMechanismSectionResult(section2) { + AssessmentLayerOne = true, AssessmentLayerTwoA = AssessmentLayerTwoAResult.Successful, AssessmentLayerThree = (RoundedDouble) random.NextDouble() }; @@ -114,14 +120,16 @@ Assert.AreEqual(2, rows.Count); var cells = rows[0].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((bool) cells[assessmentLayerOneIndex].Value); Assert.AreEqual(result1.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); Assert.AreEqual(result1.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); cells = rows[1].Cells; - Assert.AreEqual(3, cells.Count); + Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); + Assert.IsTrue((bool)cells[assessmentLayerOneIndex].Value); Assert.AreEqual(result2.AssessmentLayerTwoA, cells[assessmentLayerTwoAIndex].Value); Assert.AreEqual(result2.AssessmentLayerThree.ToString(), cells[assessmentLayerThreeIndex].FormattedValue); } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs =================================================================== diff -u -r1ff2f27e84cbd5da25a9da66d478467a773cb573 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision 1ff2f27e84cbd5da25a9da66d478467a773cb573) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Views/StabilityStoneCoverSectionResultRowTest.cs (.../StabilityStoneCoverSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -27,6 +27,7 @@ using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms.Views; @@ -36,14 +37,17 @@ public class StabilityStoneCoverSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithSectionResult_ExpectedValues() { + // Setup + var section = CreateSection(); + var result = new StabilityStoneCoverFailureMechanismSectionResult(section); + // Call - TestDelegate test = () => new StabilityStoneCoverSectionResultRow(null); + var row = new StabilityStoneCoverSectionResultRow(result); // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); + Assert.IsInstanceOf>(row); } [Test] @@ -57,7 +61,6 @@ var row = new StabilityStoneCoverSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResult.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Data/WaveImpactAsphaltCoverFailureMechanismSectionResult.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResult.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -40,22 +40,11 @@ public WaveImpactAsphaltCoverFailureMechanismSectionResult(FailureMechanismSection section) : base(section) { AssessmentLayerTwoA = (RoundedDouble) double.NaN; - AssessmentLayerThree = (RoundedDouble) double.NaN; } /// - /// Gets or sets the value representing whether the simple assessment of safety passed. - /// - public bool AssessmentLayerOne { get; set; } - - /// /// Gets or sets the value of the detailed assessment of safety per failure mechanism section. /// public RoundedDouble 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 -r944d2501b3f780d208e00015a1b850afad4c3aa8 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs) (revision 944d2501b3f780d208e00015a1b850afad4c3aa8) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRow.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -23,89 +23,38 @@ using System.ComponentModel; using Core.Common.Base.Data; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.WaveImpactAsphaltCover.Data; namespace Ringtoets.WaveImpactAsphaltCover.Forms.Views { /// /// Class for displaying as a row in a grid view. /// - internal class WaveImpactAsphaltCoverFailureMechanismSectionResultRow + internal class WaveImpactAsphaltCoverFailureMechanismSectionResultRow : FailureMechanismSectionResultRow { - private readonly WaveImpactAsphaltCoverFailureMechanismSectionResult sectionResult; - /// /// Creates a new instance of . /// /// The to wrap /// so that it can be displayed as a row. /// Thrown when is null. - public WaveImpactAsphaltCoverFailureMechanismSectionResultRow(WaveImpactAsphaltCoverFailureMechanismSectionResult sectionResult) - { - if (sectionResult == null) - { - throw new ArgumentNullException("sectionResult"); - } - this.sectionResult = sectionResult; - } + public WaveImpactAsphaltCoverFailureMechanismSectionResultRow(WaveImpactAsphaltCoverFailureMechanismSectionResult sectionResult) : base(sectionResult) {} /// - /// Gets the name of the failure mechanism section. + /// Gets the assessment layer two a of the . /// - public string Name - { - get - { - return sectionResult.Section.Name; - } - } - - /// - /// Gets or sets the value representing the result of the . - /// - public bool AssessmentLayerOne - { - get - { - return sectionResult.AssessmentLayerOne; - } - set - { - sectionResult.AssessmentLayerOne = value; - sectionResult.NotifyObservers(); - } - } - - /// - /// Gets or sets the value representing the result of the . - /// [TypeConverter(typeof(NoValueRoundedDoubleConverter))] public RoundedDouble AssessmentLayerTwoA { get { - return sectionResult.AssessmentLayerTwoA; + return SectionResult.AssessmentLayerTwoA; } set { - sectionResult.AssessmentLayerTwoA = value; + SectionResult.AssessmentLayerTwoA = value; } } - - /// - /// Gets or sets the value representing the result of the . - /// - [TypeConverter(typeof(NoValueRoundedDoubleConverter))] - public RoundedDouble AssessmentLayerThree - { - get - { - return sectionResult.AssessmentLayerThree; - } - set - { - sectionResult.AssessmentLayerThree = value; - } - } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs =================================================================== diff -u -r11f0867b39150ae5fac83dc178a89fee46d27611 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 11f0867b39150ae5fac83dc178a89fee46d27611) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using Core.Common.Base.Geometry; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; @@ -30,19 +29,8 @@ public class WaveImpactAsphaltCoverFailureMechanismSectionResultTest { [Test] - public void Constructor_WithoutSection_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new WaveImpactAsphaltCoverFailureMechanismSectionResult(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("section", paramName); - } - - [Test] - public void Constructor_WithSection_ResultCreatedForSection() - { // Setup var section = new FailureMechanismSection("Section", new[] { @@ -55,9 +43,7 @@ // Assert Assert.IsInstanceOf(result); Assert.AreSame(section, result.Section); - Assert.IsFalse(result.AssessmentLayerOne); Assert.IsNaN(result.AssessmentLayerTwoA); - Assert.IsNaN(result.AssessmentLayerThree); } } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r944d2501b3f780d208e00015a1b850afad4c3aa8 -r673e35de0df920529e5dda63ea8b4dfb08ed65a8 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs) (revision 944d2501b3f780d208e00015a1b850afad4c3aa8) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Forms.Test/Views/WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs (.../WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest.cs) (revision 673e35de0df920529e5dda63ea8b4dfb08ed65a8) @@ -20,14 +20,14 @@ // All rights reserved. using System; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Utils.Reflection; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Views; using Ringtoets.WaveImpactAsphaltCover.Data; using Ringtoets.WaveImpactAsphaltCover.Forms.Views; @@ -37,72 +37,30 @@ public class WaveImpactAsphaltCoverFailureMechanismSectionResultRowTest { [Test] - public void Constructor_WithoutSectionResult_ThrowsArgumentNullException() + public void Constructor_WithParameters_ExpectedValues() { - // Call - TestDelegate test = () => new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(null); - - // Assert - var paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("sectionResult", paramName); - } - - [Test] - public void Constructor_WithSectionResult_PropertiesFromSectionAndResult() - { // Setup - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); // Call var row = new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(result); // Assert - Assert.AreEqual(section.Name, row.Name); - Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); + Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA); - Assert.AreEqual(result.AssessmentLayerThree, row.AssessmentLayerThree); - Assert.IsTrue(TypeUtils.HasTypeConverter( r => r.AssessmentLayerTwoA)); - Assert.IsTrue(TypeUtils.HasTypeConverter( - r => r.AssessmentLayerThree)); } [Test] - [TestCase(true)] - [TestCase(false)] - public void AssessmentLayerOne_AlwaysOnChange_NotifyObserversOfResultAndResultPropertyChanged(bool newValue) - { - // Setup - var section = CreateSection(); - var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); - var row = new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(result); - - int counter = 0; - using (new Observer(() => counter++) - { - Observable = result - }) - { - // Call - row.AssessmentLayerOne = newValue; - - // Assert - Assert.AreEqual(1, counter); - Assert.AreEqual(newValue, result.AssessmentLayerOne); - } - } - - [Test] public void AssessmentLayerTwoA_AlwaysOnChange_ResultPropertyChanged() { // Setup var random = new Random(21); var newValue = random.NextDouble(); - var section = CreateSection(); + FailureMechanismSection section = CreateSection(); var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); var row = new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(result); @@ -113,23 +71,6 @@ Assert.AreEqual(newValue, result.AssessmentLayerTwoA, row.AssessmentLayerTwoA.GetAccuracy()); } - [Test] - public void AssessmentLayerThree_AlwaysOnChange_ResultPropertyChanged() - { - // Setup - var random = new Random(21); - var newValue = random.NextDouble(); - var section = CreateSection(); - var result = new WaveImpactAsphaltCoverFailureMechanismSectionResult(section); - var row = new WaveImpactAsphaltCoverFailureMechanismSectionResultRow(result); - - // Call - row.AssessmentLayerThree = (RoundedDouble) newValue; - - // Assert - Assert.AreEqual(newValue, result.AssessmentLayerThree, row.AssessmentLayerThree.GetAccuracy()); - } - private static FailureMechanismSection CreateSection() { return new FailureMechanismSection("name", new[]