Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresOutputContext.cs =================================================================== diff -u --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresOutputContext.cs (revision 0) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PresentationObjects/ClosingStructuresOutputContext.cs (revision b08299f5057df68faf4b166a7b438e275339e02f) @@ -0,0 +1,60 @@ +// 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 Ringtoets.ClosingStructures.Data; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Forms.PresentationObjects; + +namespace Ringtoets.ClosingStructures.Forms.PresentationObjects +{ + /// + /// Presentation object for the output of closing structures calculations. + /// + public class ClosingStructuresOutputContext : StructuresOutputContext + { + /// + /// Creates a new instance of . + /// + /// The structures calculation wrapped by the context object. + /// The failure mechanism the calculation belongs to. + /// The assessment section the calculation belongs to. + /// Thrown when any parameter is null. + public ClosingStructuresOutputContext(IStructuresCalculation wrappedData, + ClosingStructuresFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(wrappedData, assessmentSection) + { + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + FailureMechanism = failureMechanism; + } + + /// + /// Gets the failure mechanism. + /// + public ClosingStructuresFailureMechanism FailureMechanism { get; } + } +} \ No newline at end of file Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj =================================================================== diff -u -rfcad48d7beb394e1ac15cfe4289a7381e05aa883 -rb08299f5057df68faf4b166a7b438e275339e02f --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj (.../Ringtoets.ClosingStructures.Forms.csproj) (revision fcad48d7beb394e1ac15cfe4289a7381e05aa883) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj (.../Ringtoets.ClosingStructures.Forms.csproj) (revision b08299f5057df68faf4b166a7b438e275339e02f) @@ -13,6 +13,7 @@ + Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresOutputContextTest.cs =================================================================== diff -u --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresOutputContextTest.cs (revision 0) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresOutputContextTest.cs (revision b08299f5057df68faf4b166a7b438e275339e02f) @@ -0,0 +1,76 @@ +// 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 NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.ClosingStructures.Data; +using Ringtoets.ClosingStructures.Data.TestUtil; +using Ringtoets.ClosingStructures.Forms.PresentationObjects; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PresentationObjects; + +namespace Ringtoets.ClosingStructures.Forms.Test.PresentationObjects +{ + [TestFixture] + public class ClosingStructuresOutputContextTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var calculation = new TestClosingStructuresCalculation(); + var failureMechanism = new ClosingStructuresFailureMechanism(); + + // Call + var structuresOutputContext = new ClosingStructuresOutputContext(calculation, failureMechanism, assessmentSection); + + // Assert + Assert.IsInstanceOf(structuresOutputContext); + Assert.AreSame(calculation, structuresOutputContext.WrappedData); + Assert.AreSame(failureMechanism, structuresOutputContext.FailureMechanism); + Assert.AreSame(assessmentSection, structuresOutputContext.AssessmentSection); + mocks.VerifyAll(); + } + + [Test] + public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var calculation = new TestClosingStructuresCalculation(); + + // Call + TestDelegate call = () => new ClosingStructuresOutputContext(calculation, null, assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanism", exception.ParamName); + } + } +} \ No newline at end of file Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -rb08299f5057df68faf4b166a7b438e275339e02f --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj (.../Ringtoets.ClosingStructures.Forms.Test.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Ringtoets.ClosingStructures.Forms.Test.csproj (.../Ringtoets.ClosingStructures.Forms.Test.csproj) (revision b08299f5057df68faf4b166a7b438e275339e02f) @@ -29,6 +29,7 @@ +