Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/StructuresOutputContextTest.cs =================================================================== diff -u -rf92c12d3daee673bf220459c0c7af94893743f41 -rbf42d7f7a0afd26840ae4bbecd47ab417b2c4915 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/StructuresOutputContextTest.cs (.../StructuresOutputContextTest.cs) (revision f92c12d3daee673bf220459c0c7af94893743f41) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/StructuresOutputContextTest.cs (.../StructuresOutputContextTest.cs) (revision bf42d7f7a0afd26840ae4bbecd47ab417b2c4915) @@ -19,9 +19,11 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using Core.Common.Controls.PresentationObjects; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Forms.PresentationObjects; @@ -31,20 +33,39 @@ public class StructuresOutputContextTest { [Test] - public void ParameteredConstructor_ExpectedValues() + public void Constructor_ExpectedValues() { // Setup var mocks = new MockRepository(); var structuresCalculation = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); // Call - var structuresOutputContext = new StructuresOutputContext(structuresCalculation); + var structuresOutputContext = new StructuresOutputContext(structuresCalculation, assessmentSection); // Assert Assert.IsInstanceOf>(structuresOutputContext); Assert.AreSame(structuresCalculation, structuresOutputContext.WrappedData); + Assert.AreSame(assessmentSection, structuresOutputContext.AssessmentSection); mocks.VerifyAll(); } + + [Test] + public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var structuresCalculation = mocks.Stub(); + mocks.ReplayAll(); + + // Call + TestDelegate call = () => new StructuresOutputContext(structuresCalculation, null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + mocks.VerifyAll(); + } } } \ No newline at end of file