Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/DikeProfileContext.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/DikeProfileContext.cs (revision 0)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PresentationObjects/DikeProfileContext.cs (revision 2f9eaf6617033f3dd041197efdd372f2277bb5c2)
@@ -0,0 +1,56 @@
+// 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.Controls.PresentationObjects;
+using Ringtoets.GrassCoverErosionInwards.Data;
+
+namespace Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects
+{
+ ///
+ /// This is a presentation object for a instance.
+ ///
+ public class DikeProfileContext : WrappedObjectContextBase
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The dike profile to wrap.
+ /// The observable list of dike profiles the context belongs to.
+ /// When either
+ /// or is null.
+ public DikeProfileContext(DikeProfile dikeProfile, ObservableList dikeProfilesList)
+ : base(dikeProfile)
+ {
+ if (dikeProfilesList == null)
+ {
+ throw new ArgumentNullException("dikeProfilesList");
+ }
+ DikeProfilesList = dikeProfilesList;
+ }
+
+ ///
+ /// Gets the observable list of dike profiles.
+ ///
+ public ObservableList DikeProfilesList { get; private set; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj
===================================================================
diff -u -r5546343f650bb277b3c1937f1abf3ee0b7a7dc89 -r2f9eaf6617033f3dd041197efdd372f2277bb5c2
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision 5546343f650bb277b3c1937f1abf3ee0b7a7dc89)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision 2f9eaf6617033f3dd041197efdd372f2277bb5c2)
@@ -41,6 +41,7 @@
Properties\GlobalAssembly.cs
+
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfileContextTest.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfileContextTest.cs (revision 0)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/DikeProfileContextTest.cs (revision 2f9eaf6617033f3dd041197efdd372f2277bb5c2)
@@ -0,0 +1,79 @@
+// 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.Geometry;
+using Core.Common.Controls.PresentationObjects;
+using NUnit.Framework;
+using Ringtoets.GrassCoverErosionInwards.Data;
+using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects;
+
+namespace Ringtoets.GrassCoverErosionInwards.Forms.Test.PresentationObjects
+{
+ [TestFixture]
+ public class DikeProfileContextTest
+ {
+ [Test]
+ public void Constructor_ValidValues_ExpectedValues()
+ {
+ // Setup
+ var dikeProfile = new DikeProfile(new Point2D(0, 0));
+ var dikeProfilesList = new ObservableList();
+
+ // Call
+ var context = new DikeProfileContext(dikeProfile, dikeProfilesList);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(dikeProfile, context.WrappedData);
+ Assert.AreSame(dikeProfilesList, context.DikeProfilesList);
+ }
+
+ [Test]
+ public void Constructor_DikeProfileIsNull_ThrowArgumentNullException()
+ {
+ // Setup
+ var dikeProfilesList = new ObservableList();
+
+ // Call
+ TestDelegate call = () => new DikeProfileContext(null, dikeProfilesList);
+
+ // Assert
+ string paramName = Assert.Throws(call).ParamName;
+ Assert.AreEqual("wrappedData", paramName);
+ }
+
+ [Test]
+ public void Constructor_DikeProfilesListIsNull_ThrowArgumentNullException()
+ {
+ // Setup
+ var dikeProfile = new DikeProfile(new Point2D(0, 0));
+
+ // Call
+ TestDelegate call = () => new DikeProfileContext(dikeProfile, null);
+
+ // Assert
+ string paramName = Assert.Throws(call).ParamName;
+ Assert.AreEqual("dikeProfilesList", paramName);
+ }
+ }
+}
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj
===================================================================
diff -u -r5546343f650bb277b3c1937f1abf3ee0b7a7dc89 -r2f9eaf6617033f3dd041197efdd372f2277bb5c2
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 5546343f650bb277b3c1937f1abf3ee0b7a7dc89)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 2f9eaf6617033f3dd041197efdd372f2277bb5c2)
@@ -58,6 +58,7 @@
+ True