Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsCalculation.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsCalculation.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsCalculation.cs (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -0,0 +1,80 @@ +// 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 Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.GrassCoverErosionOutwards.Data.Properties; +using Ringtoets.Revetment.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data +{ + /// + /// Class holding information about a wave conditions calculation for the . + /// + public class GrassCoverErosionOutwardsWaveConditionsCalculation : Observable, ICalculation + { + /// + /// Creates a new instance of . + /// + public GrassCoverErosionOutwardsWaveConditionsCalculation() + { + Name = Resources.GrassCoverErosionOutwardsWaveConditionsCalculation_DefaultName; + InputParameters = new WaveConditionsInput(); + } + + /// + /// Gets the input parameters to perform a wave conditions calculation with. + /// + public WaveConditionsInput InputParameters { get; private set; } + + /// + /// Gets or sets the output which contains the results of a wave conditions calculation. + /// + public GrassCoverErosionOutwardsWaveConditionsOutput Output { get; set; } + + public string Name { get; set; } + + public string Comments { get; set; } + + public bool HasOutput + { + get + { + return Output != null; + } + } + + public void ClearOutput() + { + Output = null; + } + + public ICalculationInput GetObservableInput() + { + return InputParameters; + } + + public ICalculationOutput GetObservableOutput() + { + return Output; + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsOutput.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsOutput.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsWaveConditionsOutput.cs (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -0,0 +1,55 @@ +// 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 Core.Common.Base; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Revetment.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data +{ + /// + /// Container for the results of a grass cover erosion outwards wave conditions calculation. + /// + public class GrassCoverErosionOutwardsWaveConditionsOutput: Observable, ICalculationOutput + { + /// + /// Creates a new instance of . + /// + /// The wave conditions output items. + /// Thrown when is null. + public GrassCoverErosionOutwardsWaveConditionsOutput(IEnumerable items) + { + if (items == null) + { + throw new ArgumentNullException("items"); + } + + Items = items; + } + + /// + /// Gets the output items. + /// + public IEnumerable Items { get; private set; } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93 -r2876f9193f8ea4f2bf130601553d4f8eace0580c --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 67d5cec1f28b16cd9f4e2be9e98e22038d1f4d93) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -22,7 +22,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -98,5 +98,14 @@ return ResourceManager.GetString("GrassCoverErosionOutwardsFailureMechanism_DisplayName", resourceCulture); } } + + /// + /// Looks up a localized string similar to Nieuwe berekening. + /// + public static string GrassCoverErosionOutwardsWaveConditionsCalculation_DefaultName { + get { + return ResourceManager.GetString("GrassCoverErosionOutwardsWaveConditionsCalculation_DefaultName", resourceCulture); + } + } } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.resx =================================================================== diff -u -r5e0253e5d6a341d58a67e47830de4845e8699b0c -r2876f9193f8ea4f2bf130601553d4f8eace0580c --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.resx (.../Resources.resx) (revision 5e0253e5d6a341d58a67e47830de4845e8699b0c) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Properties/Resources.resx (.../Resources.resx) (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -123,4 +123,7 @@ Dijken en dammen - Grasbekleding erosie buitentalud + + Nieuwe berekening + \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj =================================================================== diff -u -rbfe7019fdb71a01bf3c89176c53a546f615fe47e -r2876f9193f8ea4f2bf130601553d4f8eace0580c --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision bfe7019fdb71a01bf3c89176c53a546f615fe47e) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/Ringtoets.GrassCoverErosionOutwards.Data.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.csproj) (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -42,6 +42,8 @@ + + True @@ -71,6 +73,11 @@ Ringtoets.HydraRing.Data False + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + False + Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsCalculationTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsCalculationTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsCalculationTest.cs (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -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.Linq; +using Core.Common.Base; +using NUnit.Framework; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.GrassCoverErosionOutwards.Data.Properties; +using Ringtoets.Revetment.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data.Test +{ + [TestFixture] + public class GrassCoverErosionOutwardsWaveConditionsCalculationTest + { + [Test] + public void Constructor_DefaultValues() + { + // Call + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); + + // Assert + Assert.IsInstanceOf(calculation); + Assert.IsInstanceOf(calculation); + + Assert.AreEqual(Resources.GrassCoverErosionOutwardsWaveConditionsCalculation_DefaultName, calculation.Name); + Assert.IsNotNull(calculation.InputParameters); + Assert.IsFalse(calculation.HasOutput); + Assert.IsNull(calculation.Comments); + Assert.IsNull(calculation.Output); + Assert.IsNull(calculation.InputParameters.ForeshoreProfile); + } + + [Test] + public void ClearOutput_Always_SetsOutputToNull() + { + // Setup + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) + }; + + // Precondition + Assert.IsNotNull(calculation.Output); + + // Call + calculation.ClearOutput(); + + // Assert + Assert.IsNull(calculation.Output); + } + + [Test] + public void HasOutput_OutputNull_ReturnsFalse() + { + // Setup + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + Output = null + }; + + // Call + bool hasOutput = calculation.HasOutput; + + // Assert + Assert.IsFalse(hasOutput); + } + + [Test] + public void HasOutput_OutputSet_ReturnsTrue() + { + // Setup + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation + { + Output = new GrassCoverErosionOutwardsWaveConditionsOutput(Enumerable.Empty()) + }; + + // Call + bool hasOutput = calculation.HasOutput; + + // Assert + Assert.IsTrue(hasOutput); + } + + [Test] + public void GetObservableInput_Always_ReturnsInputParameters() + { + // Setup + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); + var inputParameters = calculation.InputParameters; + + // Call + ICalculationInput input = calculation.GetObservableInput(); + + // Assert + Assert.AreSame(inputParameters, input); + } + + [Test] + public void GetObservableOutput_Always_ReturnsOutput() + { + // Setup + var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); + var output = calculation.Output; + + // Call + ICalculationOutput observableOutput = calculation.GetObservableOutput(); + + // Assert + Assert.AreSame(output, observableOutput); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsOutputTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsOutputTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsWaveConditionsOutputTest.cs (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -0,0 +1,59 @@ +// 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 NUnit.Framework; +using Ringtoets.Revetment.Data; + +namespace Ringtoets.GrassCoverErosionOutwards.Data.Test +{ + [TestFixture] + public class GrassCoverErosionOutwardsWaveConditionsOutputTest + { + [Test] + public void Constructor_OutputItemsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new GrassCoverErosionOutwardsWaveConditionsOutput(null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("items", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var outputItems = new[] + { + new WaveConditionsOutput(1, 0, 3, 5), + new WaveConditionsOutput(8, 2, 6, 1) + }; + + // Call + var output = new GrassCoverErosionOutwardsWaveConditionsOutput(outputItems); + + // Assert + Assert.AreSame(outputItems, output.Items); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj =================================================================== diff -u -rcdb131d71b5063697d38c64e8a9c516317111fcf -r2876f9193f8ea4f2bf130601553d4f8eace0580c --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj) (revision cdb131d71b5063697d38c64e8a9c516317111fcf) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Data.Test.csproj) (revision 2876f9193f8ea4f2bf130601553d4f8eace0580c) @@ -55,6 +55,8 @@ + + @@ -86,6 +88,10 @@ Ringtoets.HydraRing.Data True + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + {E7225477-577F-4A17-B7EC-6721158E1543} Ringtoets.GrassCoverErosionOutwards.Data