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.BaseFalse
+
+ {9A2D67E6-26AC-4D17-B11A-2B4372F2F572}
+ Core.Common.Controls
+ False
+ {30E4C2AE-719E-4D70-9FA9-668A9767FBFA}Core.Common.Gui
@@ -81,6 +87,11 @@
Ringtoets.Common.FormsFalse
+
+ {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.BaseTrue
+
+ {9a2d67e6-26ac-4d17-b11a-2b4372f2f572}
+ Core.Common.Controls
+ {30e4c2ae-719e-4d70-9fa9-668a9767fbfa}Core.Common.Gui
@@ -88,6 +93,10 @@
Ringtoets.Common.Data.TestUtilTrue
+
+ {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.DataFalse
+
+ {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
+
+ {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)));