Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs =================================================================== diff -u -rf108fdafb5fc608358b5088edd3192b58320b8da -rbba9524cfdab4e69348fddab60efe718e7c1865b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision f108fdafb5fc608358b5088edd3192b58320b8da) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/DesignWaterLevelLocationContextTest.cs (.../DesignWaterLevelLocationContextTest.cs) (revision bba9524cfdab4e69348fddab60efe718e7c1865b) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Core.Common.Controls.PresentationObjects; +using System; using NUnit.Framework; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PresentationObjects; @@ -30,17 +30,48 @@ public class DesignWaterLevelLocationContextTest { [Test] - public void DefaultConstructor_ExpectedValues() + public void Constructor_NullHydraulicBoundariesLocation_ThrowsArgumentNullException() { // Setup + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + + // Call + TestDelegate test = () => new DesignWaterLevelLocationContext(hydraulicBoundaryDatabase, null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocation", paramName); + } + + [Test] + public void Constructor_NullHydraulicBoundariesDatabase_ThrowsArgumentNullException() + { + // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); // Call - var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryLocation); + TestDelegate test = () => new DesignWaterLevelLocationContext(null, hydraulicBoundaryLocation); // Assert - Assert.IsInstanceOf>(presentationObject); - Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("wrappedData", paramName); } + + [Test] + public void Constructor_ValidParameters_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); + + // Call + var presentationObject = new DesignWaterLevelLocationContext(hydraulicBoundaryDatabase, hydraulicBoundaryLocation); + + // Assert + Assert.IsInstanceOf(presentationObject); + Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.WrappedData); + Assert.AreSame(hydraulicBoundaryLocation, presentationObject.HydraulicBoundaryLocation); + } } } \ No newline at end of file