Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionAssemblyService.cs =================================================================== diff -u -r4ee631efb56f645852c97ceae480f35caa20b23a -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionAssemblyService.cs (.../DuneErosionAssemblyService.cs) (revision 4ee631efb56f645852c97ceae480f35caa20b23a) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Service/DuneErosionAssemblyService.cs (.../DuneErosionAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.DuneErosion.Service { /// - /// Assembly service for assembling the assembly tool results for dune erosion. + /// Service for assembling the assembly tool results for dune erosion. /// public static class DuneErosionAssemblyService { Fisheye: Tag ebf0b79b1575d2a956cb7c7c7881e8417c915cdb refers to a dead (removed) revision in file `Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionAssemblyCalculationServiceTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionAssemblyServiceTest.cs =================================================================== diff -u --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionAssemblyServiceTest.cs (revision 0) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/DuneErosionAssemblyServiceTest.cs (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -0,0 +1,119 @@ +// Copyright (C) Stichting Deltares 2017. 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.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.KernelWrapper.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; +using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators.Assembly; +using Ringtoets.Common.Data.AssemblyTool; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.DuneErosion.Data; + +namespace Ringtoets.DuneErosion.Service.Test +{ + [TestFixture] + public class DuneErosionAssemblyServiceTest + { + [Test] + public void AssembleSimpleAssessment_FailureMechanismSectionResultNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => DuneErosionAssemblyService.AssembleSimpleAssessment(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); + } + + [Test] + public void AssembleSimpleAssessment_WithInput_SetsInputOnCalculator() + { + // Setup + var random = new Random(21); + FailureMechanismSection failureMechanismSection = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var sectionResult = new DuneErosionFailureMechanismSectionResult(failureMechanismSection) + { + SimpleAssessmentInput = random.NextEnumValue() + }; + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + + // Call + DuneErosionAssemblyService.AssembleSimpleAssessment(sectionResult); + + // Assert + Assert.AreEqual(sectionResult.SimpleAssessmentInput, calculator.SimpleAssessmentValidityOnlyInput); + } + } + + [Test] + public void AssembleSimpleAssessment_AssemblyRan_SetsOutput() + { + // Setup + FailureMechanismSection failureMechanismSection = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var sectionResult = new DuneErosionFailureMechanismSectionResult(failureMechanismSection); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + // Pre-condition + Assert.IsNull(sectionResult.SimpleAssemblyResult); + + var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + + // Call + DuneErosionAssemblyService.AssembleSimpleAssessment(sectionResult); + + // Assert + FailureMechanismSectionAssembly calculatorOutput = calculator.SimpleAssessmentAssemblyOutput; + Assert.AreSame(calculatorOutput, sectionResult.SimpleAssemblyResult); + } + } + + [Test] + public void AssembleSimpleAssessment_CalculatorThrowsExceptions_DoesNothing() + { + // Setup + FailureMechanismSection failureMechanismSection = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var sectionResult = new DuneErosionFailureMechanismSectionResult(failureMechanismSection); + + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + FailureMechanismSectionAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismSectionAssemblyCalculator; + calculator.ThrowExceptionOnCalculate = true; + + // Call + TestDelegate call = () => DuneErosionAssemblyService.AssembleSimpleAssessment(sectionResult); + + // Assert + Assert.DoesNotThrow(call); + Assert.IsNull(sectionResult.SimpleAssemblyResult); + } + } + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj =================================================================== diff -u -r4ee631efb56f645852c97ceae480f35caa20b23a -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj (.../Ringtoets.DuneErosion.Service.Test.csproj) (revision 4ee631efb56f645852c97ceae480f35caa20b23a) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Service.Test/Ringtoets.DuneErosion.Service.Test.csproj (.../Ringtoets.DuneErosion.Service.Test.csproj) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -19,7 +19,7 @@ - + Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsAssemblyService.cs =================================================================== diff -u -r7343d643411a6e53de254fbdf98cd6956b64d9ff -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsAssemblyService.cs (.../GrassCoverErosionInwardsAssemblyService.cs) (revision 7343d643411a6e53de254fbdf98cd6956b64d9ff) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Service/GrassCoverErosionInwardsAssemblyService.cs (.../GrassCoverErosionInwardsAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.GrassCoverErosionInwards.Service { /// - /// Assembly service for assembling the assembly tool results for grass cover erosion inwards. + /// Service for assembling the assembly tool results for grass cover erosion inwards. /// public static class GrassCoverErosionInwardsAssemblyService { Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsAssemblyService.cs =================================================================== diff -u -re7baf71b36aa65aceb16d5b8fec9920bb2210c55 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsAssemblyService.cs (.../GrassCoverErosionOutwardsAssemblyService.cs) (revision e7baf71b36aa65aceb16d5b8fec9920bb2210c55) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Service/GrassCoverErosionOutwardsAssemblyService.cs (.../GrassCoverErosionOutwardsAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.GrassCoverErosionOutwards.Service { /// - /// Assembly service for assembling the assembly tool results for grass cover erosion outwards. + /// Service for assembling the assembly tool results for grass cover erosion outwards. /// public static class GrassCoverErosionOutwardsAssemblyService { Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/AssemblyServices/MicrostabilityAssemblyService.cs =================================================================== diff -u -r3947596f5b78e8ad795dd30d55eeb8ef921db378 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/Integration/src/Ringtoets.Integration.Service/AssemblyServices/MicrostabilityAssemblyService.cs (.../MicrostabilityAssemblyService.cs) (revision 3947596f5b78e8ad795dd30d55eeb8ef921db378) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/AssemblyServices/MicrostabilityAssemblyService.cs (.../MicrostabilityAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.Integration.Service.AssemblyServices { /// - /// Service for assembling the assembly tool results for wave impact asphalt cover. + /// Service for assembling the assembly tool results for micro stability. /// public static class MicrostabilityAssemblyService { Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsAssemblyService.cs =================================================================== diff -u -r04515850afff2c6d345d962b4f698b8bcd0ef071 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsAssemblyService.cs (.../MacroStabilityInwardsAssemblyService.cs) (revision 04515850afff2c6d345d962b4f698b8bcd0ef071) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Service/MacroStabilityInwardsAssemblyService.cs (.../MacroStabilityInwardsAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.MacroStabilityInwards.Service { /// - /// Assembly service for assembling the assembly tool results for macro stability inwards. + /// Service for assembling the assembly tool results for macro stability inwards. /// public static class MacroStabilityInwardsAssemblyService { Index: Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingAssemblyService.cs =================================================================== diff -u -r21613ad4e6548a4eda0b3b2ef15973f93173a2d9 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingAssemblyService.cs (.../PipingAssemblyService.cs) (revision 21613ad4e6548a4eda0b3b2ef15973f93173a2d9) +++ Ringtoets/Piping/src/Ringtoets.Piping.Service/PipingAssemblyService.cs (.../PipingAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.Piping.Service { /// - /// Assembly service for assembling the assembly tool results for piping. + /// Service for assembling the assembly tool results for piping. /// public static class PipingAssemblyService { Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverAssemblyService.cs =================================================================== diff -u -r6d0dd201c531c5765fb50b4d1c13aef45fa263e5 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverAssemblyService.cs (.../StabilityStoneCoverAssemblyService.cs) (revision 6d0dd201c531c5765fb50b4d1c13aef45fa263e5) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Service/StabilityStoneCoverAssemblyService.cs (.../StabilityStoneCoverAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.StabilityStoneCover.Service { /// - /// Assembly service for assembling the assembly tool results for stability stone cover. + /// Service for assembling the assembly tool results for stability stone cover. /// public static class StabilityStoneCoverAssemblyService { Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverAssemblyService.cs =================================================================== diff -u -r5bd35f84daa9dfe636d960a4ea0efa0b85cc6e30 -rebf0b79b1575d2a956cb7c7c7881e8417c915cdb --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverAssemblyService.cs (.../WaveImpactAsphaltCoverAssemblyService.cs) (revision 5bd35f84daa9dfe636d960a4ea0efa0b85cc6e30) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Service/WaveImpactAsphaltCoverAssemblyService.cs (.../WaveImpactAsphaltCoverAssemblyService.cs) (revision ebf0b79b1575d2a956cb7c7c7881e8417c915cdb) @@ -28,7 +28,7 @@ namespace Ringtoets.WaveImpactAsphaltCover.Service { /// - /// Assembly service for assembling the assembly tool results for wave impact asphalt cover. + /// Service for assembling the assembly tool results for wave impact asphalt cover. /// public static class WaveImpactAsphaltCoverAssemblyService {