Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PresentationObjects/DuneLocationCalculationsGroupContext.cs =================================================================== diff -u --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PresentationObjects/DuneLocationCalculationsGroupContext.cs (revision 0) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PresentationObjects/DuneLocationCalculationsGroupContext.cs (revision afad5a86d5555f63edc6ee6210ac48951db08c37) @@ -0,0 +1,72 @@ +// 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.Base; +using Core.Common.Controls.PresentationObjects; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.DuneErosion.Data; + +namespace Ringtoets.DuneErosion.Forms.PresentationObjects +{ + /// + /// Presentation object for all data required to configure multiple enumerations of + /// with a dune location calculation result. + /// + public class DuneLocationCalculationsGroupContext : ObservableWrappedObjectContextBase> + { + /// + /// Creates a new instance of . + /// + /// The locations the context belongs to. + /// The failure mechanism the context belongs to. + /// The the context belongs to. + /// Thrown when any parameter is null. + public DuneLocationCalculationsGroupContext(IObservableEnumerable wrappedData, + DuneErosionFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(wrappedData) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + FailureMechanism = failureMechanism; + AssessmentSection = assessmentSection; + } + + /// + /// Gets the failure mechanism the context belongs to. + /// + public DuneErosionFailureMechanism FailureMechanism { get; } + + /// + /// Gets the assessment section the context belongs to. + /// + public IAssessmentSection AssessmentSection { get; } + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj =================================================================== diff -u -r97db62926ec7858d3d2305e71559a0453f8feb21 -rafad5a86d5555f63edc6ee6210ac48951db08c37 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision 97db62926ec7858d3d2305e71559a0453f8feb21) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/Ringtoets.DuneErosion.Forms.csproj (.../Ringtoets.DuneErosion.Forms.csproj) (revision afad5a86d5555f63edc6ee6210ac48951db08c37) @@ -21,6 +21,7 @@ + Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsGroupContextTest.cs =================================================================== diff -u --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsGroupContextTest.cs (revision 0) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PresentationObjects/DuneLocationCalculationsGroupContextTest.cs (revision afad5a86d5555f63edc6ee6210ac48951db08c37) @@ -0,0 +1,86 @@ +// 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.Base; +using Core.Common.Controls.PresentationObjects; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.DuneErosion.Data; +using Ringtoets.DuneErosion.Forms.PresentationObjects; + +namespace Ringtoets.DuneErosion.Forms.Test.PresentationObjects +{ + [TestFixture] + public class DuneLocationCalculationsGroupContextTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var mockRepository = new MockRepository(); + var assessmentSection = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var locations = new ObservableList(); + var failureMechanism = new DuneErosionFailureMechanism(); + + // Call + var context = new DuneLocationCalculationsGroupContext(locations, failureMechanism, assessmentSection); + + // Assert + Assert.IsInstanceOf>>(context); + Assert.AreSame(locations, context.WrappedData); + Assert.AreSame(failureMechanism, context.FailureMechanism); + Assert.AreSame(assessmentSection, context.AssessmentSection); + mockRepository.VerifyAll(); + } + + [Test] + public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mockRepository = new MockRepository(); + var assessmentSection = mockRepository.Stub(); + mockRepository.ReplayAll(); + + // Call + TestDelegate call = () => new DuneLocationCalculationsGroupContext(new ObservableList(), null, assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanism", exception.ParamName); + mockRepository.VerifyAll(); + } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new DuneLocationCalculationsGroupContext(new ObservableList(), new DuneErosionFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + } +} \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj =================================================================== diff -u -rd8797935f3a74fefe5db9d0c98e330a6461954a9 -rafad5a86d5555f63edc6ee6210ac48951db08c37 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision d8797935f3a74fefe5db9d0c98e330a6461954a9) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/Ringtoets.DuneErosion.Forms.Test.csproj (.../Ringtoets.DuneErosion.Forms.Test.csproj) (revision afad5a86d5555f63edc6ee6210ac48951db08c37) @@ -28,6 +28,7 @@ +