Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PresentationObjects/WaveConditionsInputContext.cs =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PresentationObjects/WaveConditionsInputContext.cs (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PresentationObjects/WaveConditionsInputContext.cs (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -0,0 +1,83 @@ +// 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 System.Collections.Generic; +using System.Linq; +using Core.Common.Controls.PresentationObjects; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.HydraRing.Data; +using Ringtoets.Revetment.Data; + +namespace Ringtoets.Revetment.Forms.PresentationObjects +{ + /// + /// Presentation object for the . + /// + public class WaveConditionsInputContext : ObservableWrappedObjectContextBase + { + private readonly IAssessmentSection assessmentSection; + + /// + /// Initializes a new instance of the class. + /// + /// The wrapped . + /// + /// The assessment section which the context belongs to. + /// Thrown when any input argument is null. + public WaveConditionsInputContext(WaveConditionsInput wrappedData, + IEnumerable foreshoreProfiles, + IAssessmentSection assessmentSection) + : base(wrappedData) + { + if (foreshoreProfiles == null) + { + throw new ArgumentNullException("foreshoreProfiles"); + } + if (assessmentSection == null) + { + throw new ArgumentNullException("assessmentSection"); + } + + ForeshoreProfiles = foreshoreProfiles; + this.assessmentSection = assessmentSection; + } + + /// + /// Gets the hydraulic boundary locations. + /// + public IEnumerable HydraulicBoundaryLocations + { + get + { + return assessmentSection.HydraulicBoundaryDatabase != null ? + assessmentSection.HydraulicBoundaryDatabase.Locations : + Enumerable.Empty(); + } + } + + /// + /// Gets the foreshore profiles. + /// + public IEnumerable ForeshoreProfiles { get; private set; } + } +} \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputBreakWaterProperties.cs =================================================================== diff -u -rae93bd6b8ccbffa91f7c5c10e898736b5919b73d -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputBreakWaterProperties.cs (.../WaveConditionsInputBreakWaterProperties.cs) (revision ae93bd6b8ccbffa91f7c5c10e898736b5919b73d) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/PropertyClasses/WaveConditionsInputBreakWaterProperties.cs (.../WaveConditionsInputBreakWaterProperties.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -92,17 +92,9 @@ [DynamicReadOnlyValidationMethod] public bool DynamicReadOnlyValidationMethod(string propertyName) { - if (data.ForeshoreProfile == null) - { - return true; - } - - if (!propertyName.Equals(TypeUtils.GetMemberName(i => i.UseBreakWater))) - { - return !UseBreakWater; - } - - return false; + return data.ForeshoreProfile == null + || !propertyName.Equals(TypeUtils.GetMemberName(i => i.UseBreakWater)) + && !UseBreakWater; } public override string ToString() Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj =================================================================== diff -u -r37213b379dafd60f815fce7cb7fd70e8b85d0ec5 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj (.../Ringtoets.Revetment.Forms.csproj) (revision 37213b379dafd60f815fce7cb7fd70e8b85d0ec5) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Ringtoets.Revetment.Forms.csproj (.../Ringtoets.Revetment.Forms.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -39,6 +39,7 @@ Properties\GlobalAssembly.cs + @@ -61,6 +62,11 @@ Core.Common.Base False + + {9A2D67E6-26AC-4D17-B11A-2B4372F2F572} + Core.Common.Controls + False + {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} Core.Common.Gui @@ -81,6 +87,11 @@ Ringtoets.Common.Forms False + + {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} + Ringtoets.HydraRing.Data + False + {87C2C553-C0BC-40BF-B1EA-B83BFF357F27} Ringtoets.Revetment.Data Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs =================================================================== diff -u --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs (revision 0) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -0,0 +1,131 @@ +// 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.Geometry; +using Core.Common.Controls.PresentationObjects; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.HydraRing.Data; +using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; + +namespace Ringtoets.Revetment.Forms.Test.PresentationObjects +{ + [TestFixture] + public class WaveConditionsInputContextTest + { + [Test] + public void Constructor_InputNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + // Call + TestDelegate call = () => new WaveConditionsInputContext(null, new ForeshoreProfile[0], assessmentSection); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("wrappedData", paramName); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_ForeshoreProfilesNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var input = new WaveConditionsInput(); + + // Call + TestDelegate call = () => new WaveConditionsInputContext(input, null, assessmentSection); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("foreshoreProfiles", paramName); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowArgumentNullException() + { + // Setup + var input = new WaveConditionsInput(); + + // Call + TestDelegate call = () => new WaveConditionsInputContext(input, new ForeshoreProfile[0], null); + + // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("assessmentSection", paramName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var locations = new[] + { + new HydraulicBoundaryLocation(0, "A", 0, 0), + new HydraulicBoundaryLocation(1, "B", 1, 1) + }; + + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + hydraulicBoundaryDatabase.Locations.AddRange(locations); + + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + mocks.ReplayAll(); + + var input = new WaveConditionsInput(); + + var foreshoreProfiles = new[] + { + new ForeshoreProfile(new Point2D(0, 0), + new Point2D[0], + null, + new ForeshoreProfile.ConstructionProperties()), + new ForeshoreProfile(new Point2D(1, 1), + new Point2D[0], + null, + new ForeshoreProfile.ConstructionProperties()) + }; + + // Call + var context = new WaveConditionsInputContext(input, foreshoreProfiles, assessmentSection); + + // Assert + Assert.IsInstanceOf>(context); + Assert.AreSame(input, context.WrappedData); + CollectionAssert.AreEqual(foreshoreProfiles, context.ForeshoreProfiles); + CollectionAssert.AreEqual(locations, context.HydraulicBoundaryLocations); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Ringtoets.Revetment.Forms.Test.csproj =================================================================== diff -u -r37213b379dafd60f815fce7cb7fd70e8b85d0ec5 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Ringtoets.Revetment.Forms.Test.csproj (.../Ringtoets.Revetment.Forms.Test.csproj) (revision 37213b379dafd60f815fce7cb7fd70e8b85d0ec5) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/Ringtoets.Revetment.Forms.Test.csproj (.../Ringtoets.Revetment.Forms.Test.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -52,6 +52,7 @@ Properties\GlobalAssembly.cs + @@ -70,6 +71,10 @@ Core.Common.Base True + + {9a2d67e6-26ac-4d17-b11a-2b4372f2f572} + Core.Common.Controls + {30e4c2ae-719e-4d70-9fa9-668a9767fbfa} Core.Common.Gui @@ -88,6 +93,10 @@ Ringtoets.Common.Data.TestUtil True + + {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2} + Ringtoets.HydraRing.Data + {87C2C553-C0BC-40BF-B1EA-B83BFF357F27} Ringtoets.Revetment.Data Fisheye: Tag bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverWaveConditionsCalculationInputContext.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextProperties.cs =================================================================== diff -u -r4cd987d7abd8340848d2159381f1d8ed4dfb7d96 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextProperties.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextProperties.cs) (revision 4cd987d7abd8340848d2159381f1d8ed4dfb7d96) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextProperties.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextProperties.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -33,6 +33,7 @@ using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.HydraRing.Data; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.Revetment.Forms.PropertyClasses; using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.Properties; @@ -42,9 +43,9 @@ namespace Ringtoets.StabilityStoneCover.Forms.PropertyClasses { /// - /// ViewModel of for properties panel. + /// ViewModel of for properties panel. /// - public class StabilityStoneCoverWaveConditionsCalculationInputContextProperties : ObjectProperties + public class StabilityStoneCoverWaveConditionsCalculationInputContextProperties : ObjectProperties { private const int hydraulicBoundaryLocationPropertyIndex = 0; private const int assessmentLevelPropertyIndex = 1; Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj =================================================================== diff -u -rd689ea05c1014eb4d51b927e11eb6c48255f0a47 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision d689ea05c1014eb4d51b927e11eb6c48255f0a47) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/Ringtoets.StabilityStoneCover.Forms.csproj (.../Ringtoets.StabilityStoneCover.Forms.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -46,7 +46,6 @@ - True Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/Ringtoets.StabilityStoneCover.Plugin.csproj =================================================================== diff -u -rd42451749e8feec1c96555eb81b1cd7d67e30146 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/Ringtoets.StabilityStoneCover.Plugin.csproj (.../Ringtoets.StabilityStoneCover.Plugin.csproj) (revision d42451749e8feec1c96555eb81b1cd7d67e30146) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/Ringtoets.StabilityStoneCover.Plugin.csproj (.../Ringtoets.StabilityStoneCover.Plugin.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -105,6 +105,11 @@ Ringtoets.Revetment.Data False + + {AF1ACFA2-AEE5-4DB7-98CA-8B3720E46AD9} + Ringtoets.Revetment.Forms + False + {2331235F-1E56-4344-ACC2-191C22A39594} Ringtoets.Revetment.Service Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs =================================================================== diff -u -r7719a619d76f39384209dba87f836da02cf2846a -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 7719a619d76f39384209dba87f836da02cf2846a) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -38,6 +38,7 @@ using Ringtoets.Common.Forms.TreeNodeInfos; using Ringtoets.HydraRing.Data; using Ringtoets.HydraRing.IO; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.Revetment.Service; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms; @@ -62,7 +63,7 @@ public override IEnumerable GetPropertyInfos() { yield return new PropertyInfo(); - yield return new PropertyInfo(); + yield return new PropertyInfo(); yield return new PropertyInfo(); } @@ -98,7 +99,7 @@ WaveConditionsCalculationContextContextMenuStrip, WaveConditionsCalculationContextOnNodeRemoved); - yield return new TreeNodeInfo + yield return new TreeNodeInfo { Text = context => RingtoetsCommonFormsResources.Calculation_Input, Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, @@ -470,9 +471,9 @@ var childNodes = new List { new CommentContext(context.WrappedData), - new StabilityStoneCoverWaveConditionsCalculationInputContext(context.WrappedData.InputParameters, - context.FailureMechanism, - context.AssessmentSection) + new WaveConditionsInputContext(context.WrappedData.InputParameters, + context.FailureMechanism.ForeshoreProfiles, + context.AssessmentSection) }; if (context.WrappedData.HasOutput) Fisheye: Tag bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c refers to a dead (removed) revision in file `Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverWaveConditionsCalculationInputContextTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextPropertiesTest.cs =================================================================== diff -u -r886d05e5ddb1f4aedff9a25e85aefe95b83a3d18 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextPropertiesTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextPropertiesTest.cs) (revision 886d05e5ddb1f4aedff9a25e85aefe95b83a3d18) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/PropertyClasses/StabilityStoneCoverWaveConditionsCalculationInputContextPropertiesTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextPropertiesTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -35,8 +35,8 @@ using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; -using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; namespace Ringtoets.StabilityStoneCover.Forms.Test.PropertyClasses @@ -76,7 +76,7 @@ var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties(); // Assert - Assert.IsInstanceOf>(properties); + Assert.IsInstanceOf>(properties); Assert.IsNull(properties.Data); } @@ -90,7 +90,7 @@ var failureMechanism = new StabilityStoneCoverFailureMechanism(); var input = new WaveConditionsInput(); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, failureMechanism, assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSectionMock); // Call var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties @@ -170,7 +170,10 @@ LowerBoundaryWaterLevels = lowerBoundaryWaterLevels, StepSize = stepSize }; - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, failureMechanism, assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(input, new[] + { + foreshoreProfile + }, assessmentSectionMock); // Call var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties @@ -220,7 +223,7 @@ var input = new WaveConditionsInput(); input.Attach(observerMock); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, failureMechanism, assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(input, new ForeshoreProfile[0], assessmentSectionMock); var newForeshoreProfile = new ForeshoreProfile( new Point2D( @@ -274,15 +277,20 @@ var failureMechanism = new StabilityStoneCoverFailureMechanism(); var input = new WaveConditionsInput(); + var foreshoreProfile = new ForeshoreProfile( + new Point2D(0,0), + Enumerable.Empty(), + null, + new ForeshoreProfile.ConstructionProperties()); + if (withForeshoreProfile) { - input.ForeshoreProfile = new ForeshoreProfile( - new Point2D(0,0), - Enumerable.Empty(), - null, - new ForeshoreProfile.ConstructionProperties()); + input.ForeshoreProfile = foreshoreProfile; } - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, failureMechanism, assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(input, new[] + { + foreshoreProfile + }, assessmentSectionMock); // Call var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj =================================================================== diff -u -r8e0924d08a2377125c21114d088b6091bf1eb5fc -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision 8e0924d08a2377125c21114d088b6091bf1eb5fc) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/Ringtoets.StabilityStoneCover.Forms.Test.csproj (.../Ringtoets.StabilityStoneCover.Forms.Test.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -73,7 +73,6 @@ - Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r0f6049b15bcadf8de3a59c74e829f27bb725c013 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 0f6049b15bcadf8de3a59c74e829f27bb725c013) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -45,6 +45,7 @@ using Ringtoets.HydraRing.Calculation.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.Revetment.Service.TestUtil; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; @@ -153,14 +154,35 @@ public void ChildNodeObjects_CalculationWithoutOutput_ReturnChildrenWithEmptyOutput() { // Setup + var location = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + Locations = + { + location + } + }; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; mocks.ReplayAll(); var calculation = new StabilityStoneCoverWaveConditionsCalculation { Output = null }; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 1), + new ForeshoreProfile.ConstructionProperties()); + + var failureMechanism = new StabilityStoneCoverFailureMechanism + { + ForeshoreProfiles = + { + foreshoreProfile + } + }; var context = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, failureMechanism, assessmentSection); @@ -174,10 +196,10 @@ var commentsContext = (CommentContext) children[0]; Assert.AreSame(calculation, commentsContext.WrappedData); - var inputContext = (StabilityStoneCoverWaveConditionsCalculationInputContext) children[1]; + var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - Assert.AreSame(failureMechanism, inputContext.FailureMechanism); - Assert.AreSame(assessmentSection, inputContext.AssessmentSection); + CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); Assert.IsInstanceOf(children[2]); } @@ -186,15 +208,36 @@ public void ChildNodeObjects_CalculationWithOutput_ReturnChildrenWithOutput() { // Setup + var location = new HydraulicBoundaryLocation(0, string.Empty, 0, 0); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + Locations = + { + location + } + }; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; mocks.ReplayAll(); var calculation = new StabilityStoneCoverWaveConditionsCalculation { Output = new StabilityStoneCoverWaveConditionsOutput(Enumerable.Empty(), Enumerable.Empty()) }; - var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), + Enumerable.Empty(), + new BreakWater(BreakWaterType.Caisson, 1), + new ForeshoreProfile.ConstructionProperties()); + + var failureMechanism = new StabilityStoneCoverFailureMechanism + { + ForeshoreProfiles = + { + foreshoreProfile + } + }; var context = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, failureMechanism, assessmentSection); @@ -208,10 +251,10 @@ var commentsContext = (CommentContext) children[0]; Assert.AreSame(calculation, commentsContext.WrappedData); - var inputContext = (StabilityStoneCoverWaveConditionsCalculationInputContext) children[1]; + var inputContext = (WaveConditionsInputContext) children[1]; Assert.AreSame(calculation.InputParameters, inputContext.WrappedData); - Assert.AreSame(failureMechanism, inputContext.FailureMechanism); - Assert.AreSame(assessmentSection, inputContext.AssessmentSection); + CollectionAssert.AreEqual(new[] { foreshoreProfile }, inputContext.ForeshoreProfiles); + CollectionAssert.AreEqual(new[] { location }, inputContext.HydraulicBoundaryLocations); var output = (StabilityStoneCoverWaveConditionsOutput) children[2]; Assert.AreSame(calculation.Output, output); Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationInputContextTreeNodeInfoTest.cs =================================================================== diff -u -r0d7efa62d16c64a925c63172e4d1bf1a4e0bf94f -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationInputContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextTreeNodeInfoTest.cs) (revision 0d7efa62d16c64a925c63172e4d1bf1a4e0bf94f) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationInputContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextTreeNodeInfoTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -28,9 +28,10 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; -using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Plugin; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -81,10 +82,9 @@ mocks.ReplayAll(); var input = new WaveConditionsInput(); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var context = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, - failureMechanism, - assessmentSection); + var context = new WaveConditionsInputContext(input, + new ForeshoreProfile[0], + assessmentSection); using (var plugin = new StabilityStoneCoverPlugin()) { @@ -106,10 +106,9 @@ mocks.ReplayAll(); var input = new WaveConditionsInput(); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var context = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, - failureMechanism, - assessmentSection); + var context = new WaveConditionsInputContext(input, + new ForeshoreProfile[0], + assessmentSection); using (var plugin = new StabilityStoneCoverPlugin()) { var info = GetInfo(plugin); @@ -130,10 +129,9 @@ var assessmentSection = mocks.Stub(); var input = new WaveConditionsInput(); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - var context = new StabilityStoneCoverWaveConditionsCalculationInputContext(input, - failureMechanism, - assessmentSection); + var context = new WaveConditionsInputContext(input, + new ForeshoreProfile[0], + assessmentSection); var menuBuilder = mocks.StrictMock(); menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder); @@ -160,7 +158,7 @@ private TreeNodeInfo GetInfo(StabilityStoneCoverPlugin plugin) { - return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsCalculationInputContext)); + return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveConditionsInputContext)); } } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsCalculationInputContextForeshoreProfileEditorTest.cs =================================================================== diff -u -r4cd987d7abd8340848d2159381f1d8ed4dfb7d96 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsCalculationInputContextForeshoreProfileEditorTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextForeshoreProfileEditorTest.cs) (revision 4cd987d7abd8340848d2159381f1d8ed4dfb7d96) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsCalculationInputContextForeshoreProfileEditorTest.cs (.../StabilityStoneCoverWaveConditionsCalculationInputContextForeshoreProfileEditorTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -29,8 +29,8 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; -using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; using Ringtoets.StabilityStoneCover.Forms.UITypeEditors; @@ -53,18 +53,18 @@ // Setup var failureMechanism = new StabilityStoneCoverFailureMechanism { - ForeshoreProfiles = + ForeshoreProfiles = { new ForeshoreProfile(new Point2D(0, 0), new Point2D[0], - null, new ForeshoreProfile.ConstructionProperties()) + null, new ForeshoreProfile.ConstructionProperties()) } }; var grassCoverErosionInwardsInput = new WaveConditionsInput(); var assessmentSectionMock = mockRepository.StrictMock(); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(grassCoverErosionInwardsInput, - failureMechanism, - assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(grassCoverErosionInwardsInput, + failureMechanism.ForeshoreProfiles, + assessmentSectionMock); var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties { @@ -98,7 +98,7 @@ { // Setup var foreshoreProfile = new ForeshoreProfile(new Point2D(0, 0), new Point2D[0], - null, new ForeshoreProfile.ConstructionProperties()); + null, new ForeshoreProfile.ConstructionProperties()); var failureMechanism = new StabilityStoneCoverFailureMechanism { ForeshoreProfiles = @@ -112,9 +112,9 @@ }; var assessmentSectionMock = mockRepository.StrictMock(); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(waveConditionsInput, - failureMechanism, - assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(waveConditionsInput, + failureMechanism.ForeshoreProfiles, + assessmentSectionMock); var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties { Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsInputContextHydraulicBoundaryLocationEditorTest.cs =================================================================== diff -u -re4313e642aa3af2d1f1ced4c397c421579cfb36d -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsInputContextHydraulicBoundaryLocationEditorTest.cs (.../StabilityStoneCoverWaveConditionsInputContextHydraulicBoundaryLocationEditorTest.cs) (revision e4313e642aa3af2d1f1ced4c397c421579cfb36d) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Forms.Test/UITypeEditors/StabilityStoneCoverWaveConditionsInputContextHydraulicBoundaryLocationEditorTest.cs (.../StabilityStoneCoverWaveConditionsInputContextHydraulicBoundaryLocationEditorTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -26,10 +26,11 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.HydraRing.Data; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; -using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; using Ringtoets.StabilityStoneCover.Forms.UITypeEditors; @@ -53,16 +54,15 @@ var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(new TestHydraulicBoundaryLocation()); - var failureMechanism = new StabilityStoneCoverFailureMechanism(); var grassCoverErosionInwardsInput = new WaveConditionsInput(); var assessmentSectionMock = mockRepository.StrictMock(); assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase) .Return(hydraulicBoundaryDatabase) .Repeat.AtLeastOnce(); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(grassCoverErosionInwardsInput, - failureMechanism, - assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(grassCoverErosionInwardsInput, + new ForeshoreProfile[0], + assessmentSectionMock); var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties { @@ -108,9 +108,9 @@ assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase) .Return(hydraulicBoundaryDatabase) .Repeat.AtLeastOnce(); - var inputContext = new StabilityStoneCoverWaveConditionsCalculationInputContext(waveConditionsInput, - failureMechanism, - assessmentSectionMock); + var inputContext = new WaveConditionsInputContext(waveConditionsInput, + new ForeshoreProfile[0], + assessmentSectionMock); var properties = new StabilityStoneCoverWaveConditionsCalculationInputContextProperties { Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj =================================================================== diff -u -rc43715cf3e6dce0c427b10c4852d5ae54e6d668d -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj (.../Ringtoets.StabilityStoneCover.Plugin.Test.csproj) (revision c43715cf3e6dce0c427b10c4852d5ae54e6d668d) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/Ringtoets.StabilityStoneCover.Plugin.Test.csproj (.../Ringtoets.StabilityStoneCover.Plugin.Test.csproj) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -97,6 +97,10 @@ {4d840673-3812-4338-a352-84854e32b8a0} Ringtoets.Common.Forms + + {AF1ACFA2-AEE5-4DB7-98CA-8B3720E46AD9} + Ringtoets.Revetment.Forms + {b479e3af-7c34-488c-bb73-d324100d36c9} Ringtoets.StabilityStoneCover.Data Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs =================================================================== diff -u -r9bb8d5dab740264ba9f3e50181e310ee2c9525f8 -rbfe0c885c674d20d6ed6fbfb95e9cdc484b4788c --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision 9bb8d5dab740264ba9f3e50181e310ee2c9525f8) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision bfe0c885c674d20d6ed6fbfb95e9cdc484b4788c) @@ -27,6 +27,7 @@ using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.Revetment.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Data; using Ringtoets.StabilityStoneCover.Forms.PresentationObjects; using Ringtoets.StabilityStoneCover.Forms.PropertyClasses; @@ -54,7 +55,7 @@ StabilityStoneCoverFailureMechanismContext, StabilityStoneCoverFailureMechanismContextProperties>(propertyInfos); PluginTestHelper.AssertPropertyInfoDefined< - StabilityStoneCoverWaveConditionsCalculationInputContext, + WaveConditionsInputContext, StabilityStoneCoverWaveConditionsCalculationInputContextProperties>(propertyInfos); PluginTestHelper.AssertPropertyInfoDefined< StabilityStoneCoverWaveConditionsOutput, @@ -95,7 +96,7 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverFailureMechanismContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsCalculationGroupContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsCalculationContext))); - Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsCalculationInputContext))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveConditionsInputContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyStabilityStoneCoverOutput))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismSectionResultContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsOutput)));