Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj =================================================================== diff -u -r2ffec498317b3c7b3340430cfeccb0ef1f4210fc -r656d5126496add226d3bbdb348ef4a4354e4119e --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.csproj) (revision 2ffec498317b3c7b3340430cfeccb0ef1f4210fc) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/Ringtoets.WaveImpactAsphaltCover.Service.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.csproj) (revision 656d5126496add226d3bbdb348ef4a4354e4119e) @@ -40,6 +40,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverDataSynchronizationService.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverDataSynchronizationService.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverDataSynchronizationService.cs (revision 656d5126496add226d3bbdb348ef4a4354e4119e) @@ -0,0 +1,49 @@ +// 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 Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.WaveImpactAsphaltCover.Service +{ + /// + /// Service for synchronizing wave impact asphalt cover data. + /// + public static class WaveImpactAsphaltCoverDataSynchronizationService + { + /// + /// Clears the output of the given . + /// + /// The + /// to clear the output for. + /// Thrown when + /// is null. + public static void ClearWaveConditionsCalculationOutput(WaveImpactAsphaltCoverWaveConditionsCalculation calculation) + { + if (calculation == null) + { + throw new ArgumentNullException("calculation"); + } + + calculation.Output = null; + } + } +} \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/Ringtoets.WaveImpactAsphaltCover.Service.Test.csproj =================================================================== diff -u -r2ffec498317b3c7b3340430cfeccb0ef1f4210fc -r656d5126496add226d3bbdb348ef4a4354e4119e --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/Ringtoets.WaveImpactAsphaltCover.Service.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.Test.csproj) (revision 2ffec498317b3c7b3340430cfeccb0ef1f4210fc) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/Ringtoets.WaveImpactAsphaltCover.Service.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Service.Test.csproj) (revision 656d5126496add226d3bbdb348ef4a4354e4119e) @@ -53,6 +53,7 @@ Properties\GlobalAssembly.cs + @@ -74,6 +75,10 @@ {888D4097-8BC2-4703-9FB1-8744C94D525E} Ringtoets.HydraRing.Calculation + + {87c2c553-c0bc-40bf-b1ea-b83bff357f27} + Ringtoets.Revetment.Data + {567E0B69-5280-41CE-ADD6-443725A61C86} Ringtoets.WaveImpactAsphaltCover.Data Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverDataSynchronizationServiceTest.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverDataSynchronizationServiceTest.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Service.Test/WaveImpactAsphaltCoverDataSynchronizationServiceTest.cs (revision 656d5126496add226d3bbdb348ef4a4354e4119e) @@ -0,0 +1,63 @@ +// 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.Linq; +using NUnit.Framework; +using Ringtoets.Revetment.Data; +using Ringtoets.WaveImpactAsphaltCover.Data; + +namespace Ringtoets.WaveImpactAsphaltCover.Service.Test +{ + [TestFixture] + public class WaveImpactAsphaltCoverDataSynchronizationServiceTest + { + [Test] + public void ClearWaveConditionsCalculation_CalculationNull_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => WaveImpactAsphaltCoverDataSynchronizationService.ClearWaveConditionsCalculationOutput(null); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("calculation", exception.ParamName); + } + + [Test] + public void ClearWaveConditionsCalculation_WithCalculation_OutputNull() + { + // Setup + var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation + { + Output = new WaveImpactAsphaltCoverWaveConditionsOutput(Enumerable.Empty()) + }; + + // Precondition + Assert.IsNotNull(calculation.Output); + + // Call + WaveImpactAsphaltCoverDataSynchronizationService.ClearWaveConditionsCalculationOutput(calculation); + + // Assert + Assert.IsNull(calculation.Output); + } + } +} \ No newline at end of file