Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContext.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContext.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContext.cs (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee) @@ -0,0 +1,62 @@ +// 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 System.Collections.Generic; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.Data; + +namespace Ringtoets.MacroStabilityInwards.Forms.PresentationObjects +{ + /// + /// This class is a presentation object for a collection of + /// for macro stability inwards. + /// + public class MacroStabilityInwardsFailureMechanismSectionResultContext : FailureMechanismSectionResultContext + { + /// + /// Creates a new instance of . + /// + /// The of to wrap. + /// The the belongs to. + /// The assessment section the section results belong to. + /// Thrown when any parameter is null. + public MacroStabilityInwardsFailureMechanismSectionResultContext(IEnumerable wrappedSectionResults, + IFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + : base(wrappedSectionResults, failureMechanism) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + AssessmentSection = assessmentSection; + } + + /// + /// Gets the . + /// + public IAssessmentSection AssessmentSection { get; } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj =================================================================== diff -u -r0bc724e93170500800aa7e5d3bf641ab44eeeac7 -r92ab94a95c16545cca57a9a0e84ffa94404469ee --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 0bc724e93170500800aa7e5d3bf641ab44eeeac7) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee) @@ -20,6 +20,7 @@ + Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContextTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContextTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContextTest.cs (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee) @@ -0,0 +1,71 @@ +// 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 System.Collections.Generic; +using System.Linq; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.MacroStabilityInwards.Data; +using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects; + +namespace Ringtoets.MacroStabilityInwards.Forms.Test.PresentationObjects +{ + [TestFixture] + public class MacroStabilityInwardsFailureMechanismSectionResultContextTest + { + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new MacroStabilityInwardsFailureMechanismSectionResultContext(Enumerable.Empty(), + new MacroStabilityInwardsFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + IEnumerable sectionResults = Enumerable.Empty(); + var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + + // Call + var context = new MacroStabilityInwardsFailureMechanismSectionResultContext(sectionResults, failureMechanism, assessmentSection); + + // Assert + Assert.IsInstanceOf>(context); + Assert.AreSame(sectionResults, context.WrappedData); + Assert.AreSame(failureMechanism, context.FailureMechanism); + Assert.AreSame(assessmentSection, context.AssessmentSection); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj =================================================================== diff -u -r0bc724e93170500800aa7e5d3bf641ab44eeeac7 -r92ab94a95c16545cca57a9a0e84ffa94404469ee --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 0bc724e93170500800aa7e5d3bf641ab44eeeac7) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee) @@ -29,6 +29,7 @@ + Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismSectionResultContext.cs =================================================================== diff -u -rf4c4fe2feedd73d2f45395017b77df2bb56d5c27 -r92ab94a95c16545cca57a9a0e84ffa94404469ee --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismSectionResultContext.cs (.../PipingFailureMechanismSectionResultContext.cs) (revision f4c4fe2feedd73d2f45395017b77df2bb56d5c27) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismSectionResultContext.cs (.../PipingFailureMechanismSectionResultContext.cs) (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee) @@ -35,9 +35,9 @@ public class PipingFailureMechanismSectionResultContext : FailureMechanismSectionResultContext { /// - /// Creates a new instance of . + /// Creates a new instance of . /// - /// The of to wrap. + /// The of to wrap. /// The the belongs to. /// The assessment section the section results belong to. /// Thrown when any parameter is null.