Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -re1d4d3fe987bfa6504703952ea0dbd8a18f5a698 -r1d540d2625cac50321e2400129af64df6cd21310 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision e1d4d3fe987bfa6504703952ea0dbd8a18f5a698) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 1d540d2625cac50321e2400129af64df6cd21310) @@ -30,6 +30,7 @@ using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Service.MessageProviders; +using Ringtoets.HydraRing.Calculation.Activities; using Ringtoets.HydraRing.Calculation.Calculator.Factory; using Ringtoets.HydraRing.Calculation.TestUtil.Calculator; @@ -71,7 +72,7 @@ calculationMessageProviderMock); // Assert - Assert.IsInstanceOf(activity); + Assert.IsInstanceOf(activity); Assert.AreSame(activityName, activity.Name); Assert.IsNull(activity.ProgressText); Assert.AreEqual(ActivityState.None, activity.State); Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationActivity.cs =================================================================== diff -u --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationActivity.cs (revision 0) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionBoundaryCalculationActivity.cs (revision 1d540d2625cac50321e2400129af64df6cd21310) @@ -0,0 +1,77 @@ +// 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.Service; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.DuneErosion.Data; +using Ringtoets.HydraRing.Calculation.Activities; + +namespace Ringtoets.DuneErosion.Service +{ + /// + /// for running a dune erosion boundary calculation. + /// + public class DuneErosionBoundaryCalculationActivity : HydraRingActivityBase + { + private readonly DuneLocation duneLocation; + private readonly DuneErosionFailureMechanism failureMechanism; + private readonly IAssessmentSection assessmentSection; + + /// + /// Creates a new instance of . + /// + /// The to perform the calculation for. + /// The that holds information about the contribution and + /// the general inputs used in the calculation. + /// The that hold information about the norm used in the calculation. + /// Thrown when any parameter is null. + public DuneErosionBoundaryCalculationActivity(DuneLocation duneLocation, + DuneErosionFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (duneLocation == null) + { + throw new ArgumentNullException("duneLocation"); + } + if (failureMechanism == null) + { + throw new ArgumentNullException("failureMechanism"); + } + if (assessmentSection == null) + { + throw new ArgumentNullException("assessmentSection"); + } + + this.duneLocation = duneLocation; + this.failureMechanism = failureMechanism; + this.assessmentSection = assessmentSection; + + Name = duneLocation.Name; + } + + protected override void PerformCalculation() {} + + protected override void OnCancel() {} + + protected override void OnFinish() {} + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj =================================================================== diff -u -rfb58ab4a91a86c0b07665d31beb2334bdbd18413 -r1d540d2625cac50321e2400129af64df6cd21310 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision fb58ab4a91a86c0b07665d31beb2334bdbd18413) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/Ringtoets.DuneErosion.Service.csproj (.../Ringtoets.DuneErosion.Service.csproj) (revision 1d540d2625cac50321e2400129af64df6cd21310) @@ -43,6 +43,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationActivityTest.cs =================================================================== diff -u --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationActivityTest.cs (revision 0) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionBoundaryCalculationActivityTest.cs (revision 1d540d2625cac50321e2400129af64df6cd21310) @@ -0,0 +1,111 @@ +// 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.Service; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.DuneErosion.Data; +using Ringtoets.DuneErosion.Data.TestUtil; +using Ringtoets.HydraRing.Calculation.Activities; + +namespace Ringtoets.DuneErosion.Service.Test +{ + [TestFixture] + public class DuneErosionBoundaryCalculationActivityTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var duneLocation = new TestDuneLocation(); + var failureMechanism = new DuneErosionFailureMechanism(); + + // Call + var activity = new DuneErosionBoundaryCalculationActivity(duneLocation, failureMechanism, assessmentSection); + + // Assert + Assert.IsInstanceOf(activity); + Assert.AreEqual(duneLocation.Name, activity.Name); + Assert.IsNull(activity.ProgressText); + Assert.AreEqual(ActivityState.None, activity.State); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_DuneLocationNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new DuneErosionFailureMechanism(); + + // Call + TestDelegate test = () => new DuneErosionBoundaryCalculationActivity(null, failureMechanism, assessmentSection); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("duneLocation", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_FailureMechanismNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var duneLocation = new TestDuneLocation(); + + // Call + TestDelegate test = () => new DuneErosionBoundaryCalculationActivity(duneLocation, null, assessmentSection); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("failureMechanism", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowArgumentNullException() + { + // Setup + var duneLocation = new TestDuneLocation(); + var failureMechanism = new DuneErosionFailureMechanism(); + + // Call + TestDelegate test = () => new DuneErosionBoundaryCalculationActivity(duneLocation, failureMechanism, null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj =================================================================== diff -u -rfb58ab4a91a86c0b07665d31beb2334bdbd18413 -r1d540d2625cac50321e2400129af64df6cd21310 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj (.../Ringtoets.DuneErosion.Service.Test.csproj) (revision fb58ab4a91a86c0b07665d31beb2334bdbd18413) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj (.../Ringtoets.DuneErosion.Service.Test.csproj) (revision 1d540d2625cac50321e2400129af64df6cd21310) @@ -57,6 +57,7 @@ Properties\GlobalAssembly.cs +