Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs =================================================================== diff -u -r407f2cd70c80899d9a6c70e98cbc5a9b3480784b -rac2ef64a966ba1988c30df9773b383716e133eef --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs (.../AssessmentSectionMergeHandler.cs) (revision 407f2cd70c80899d9a6c70e98cbc5a9b3480784b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Merge/AssessmentSectionMergeHandler.cs (.../AssessmentSectionMergeHandler.cs) (revision ac2ef64a966ba1988c30df9773b383716e133eef) @@ -19,7 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; +using Core.Common.Gui.Commands; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Integration.Data; @@ -30,7 +32,28 @@ /// public class AssessmentSectionMergeHandler : IAssessmentSectionMergeHandler { + private readonly IViewCommands viewCommands; + + /// + /// Creates a new instance of . + /// + /// The view commands used to close views for the target + /// . + /// Thrown when + /// is null. + public AssessmentSectionMergeHandler(IViewCommands viewCommands) + { + if (viewCommands == null) + { + throw new ArgumentNullException(nameof(viewCommands)); + } + + this.viewCommands = viewCommands; + } + public void PerformMerge(AssessmentSection targetAssessmentSection, AssessmentSection sourceAssessmentSection, - IEnumerable failureMechanismsToMerge) {} + IEnumerable failureMechanismsToMerge) + { + } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs =================================================================== diff -u -r407f2cd70c80899d9a6c70e98cbc5a9b3480784b -rac2ef64a966ba1988c30df9773b383716e133eef --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs (.../AssessmentSectionMergeHandlerTest.cs) (revision 407f2cd70c80899d9a6c70e98cbc5a9b3480784b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Merge/AssessmentSectionMergeHandlerTest.cs (.../AssessmentSectionMergeHandlerTest.cs) (revision ac2ef64a966ba1988c30df9773b383716e133eef) @@ -19,7 +19,10 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using Core.Common.Gui.Commands; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Integration.Plugin.Merge; namespace Ringtoets.Integration.Plugin.Test.Merge @@ -28,13 +31,30 @@ public class AssessmentSectionMergeHandlerTest { [Test] + public void Constructor_ViewCommandsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new AssessmentSectionMergeHandler(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("viewCommands", exception.ParamName); + } + + [Test] public void Constructor_ExpectedValues() { + // Setup + var mocks = new MockRepository(); + var viewCommands = mocks.StrictMock(); + mocks.ReplayAll(); + // Call - var handler = new AssessmentSectionMergeHandler(); + var handler = new AssessmentSectionMergeHandler(viewCommands); // Assert Assert.IsInstanceOf(handler); + mocks.VerifyAll(); } } } \ No newline at end of file