Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs =================================================================== diff -u -r0c889cff16b60d497640a21c3c9a2ede888dd263 -rbda1b9542e899c34dfa695d5e14411a4f52de809 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs (.../WaveConditionsInputContextTest.cs) (revision 0c889cff16b60d497640a21c3c9a2ede888dd263) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.Test/PresentationObjects/WaveConditionsInputContextTest.cs (.../WaveConditionsInputContextTest.cs) (revision bda1b9542e899c34dfa695d5e14411a4f52de809) @@ -20,41 +20,87 @@ // All rights reserved. using System; +using System.Collections.Generic; using Core.Common.Controls.PresentationObjects; using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Data.TestUtil; using Ringtoets.Revetment.Forms.PresentationObjects; -using Ringtoets.Revetment.Forms.TestUtil; namespace Ringtoets.Revetment.Forms.Test.PresentationObjects { [TestFixture] public class WaveConditionsInputContextTest { [Test] - public void Constructor_WaveConditionsInputNull_ThrowArgumentNullException() + public void Constructor_CalculationNull_ThrowArgumentNullException() { + // Setup + var waveConditionsInput = new WaveConditionsInput(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + // Call - TestDelegate call = () => new TestWaveConditionsInputContext(null); + TestDelegate call = () => new TestWaveConditionsInputContext(waveConditionsInput, + null, + assessmentSection); // Assert string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("wrappedData", paramName); + Assert.AreEqual("calculation", paramName); } [Test] - public void Constructor_ExpectedValues() + public void Constructor_AssessmentSectionNull_ThrowArgumentNullException() { // Setup - var input = new WaveConditionsInput(); + var waveConditionsInput = new WaveConditionsInput(); + var calculation = new TestWaveConditionsCalculation(); // Call - var context = new TestWaveConditionsInputContext(input); + TestDelegate call = () => new TestWaveConditionsInputContext(waveConditionsInput, + calculation, + null); // Assert + string paramName = Assert.Throws(call).ParamName; + Assert.AreEqual("assessmentSection", paramName); + } + + [Test] + public void Constructor_ValidInput_ExpectedValues() + { + // Setup + var waveConditionsInput = new WaveConditionsInput(); + var calculation = new TestWaveConditionsCalculation(); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + + // Call + var context = new TestWaveConditionsInputContext(waveConditionsInput, + calculation, + assessmentSection); + + // Assert Assert.IsInstanceOf>(context); - Assert.IsInstanceOf(context); - Assert.AreSame(input, context.WrappedData); + Assert.AreSame(waveConditionsInput, context.WrappedData); + Assert.AreSame(calculation, context.Calculation); + Assert.AreSame(assessmentSection, context.AssessmentSection); } + + private class TestWaveConditionsInputContext : WaveConditionsInputContext + { + public TestWaveConditionsInputContext(WaveConditionsInput wrappedData, + ICalculation calculation, + IAssessmentSection assessmentSection) + : base(wrappedData, calculation, assessmentSection) {} + + public override IEnumerable HydraulicBoundaryLocations { get; } + + public override IEnumerable ForeshoreProfiles { get; } + } } } \ No newline at end of file Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil.Test/TestWaveConditionsInputContextTest.cs =================================================================== diff -u -raf6d59e5d91e62762272f7480914b2e7c445b4d3 -rbda1b9542e899c34dfa695d5e14411a4f52de809 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil.Test/TestWaveConditionsInputContextTest.cs (.../TestWaveConditionsInputContextTest.cs) (revision af6d59e5d91e62762272f7480914b2e7c445b4d3) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil.Test/TestWaveConditionsInputContextTest.cs (.../TestWaveConditionsInputContextTest.cs) (revision bda1b9542e899c34dfa695d5e14411a4f52de809) @@ -20,6 +20,8 @@ // All rights reserved. using NUnit.Framework; +using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Revetment.Data; using Ringtoets.Revetment.Data.TestUtil; @@ -53,16 +55,8 @@ { // Setup var waveConditionsInput = new WaveConditionsInput(); - var profiles = new[] - { - new TestForeshoreProfile("test1"), - new TestForeshoreProfile("test2") - }; - var locations = new[] - { - new TestHydraulicBoundaryLocation(), - new TestHydraulicBoundaryLocation() - }; + var profiles = new ForeshoreProfile[0]; + var locations = new HydraulicBoundaryLocation[0]; // Call var context = new TestWaveConditionsInputContext(waveConditionsInput, profiles, locations); @@ -83,16 +77,8 @@ var waveConditionsInput = new WaveConditionsInput(); var calculation = new TestWaveConditionsCalculation(); var assessmentSection = new ObservableTestAssessmentSectionStub(); - var profiles = new[] - { - new TestForeshoreProfile("test1"), - new TestForeshoreProfile("test2") - }; - var locations = new[] - { - new TestHydraulicBoundaryLocation(), - new TestHydraulicBoundaryLocation() - }; + var profiles = new ForeshoreProfile[0]; + var locations = new HydraulicBoundaryLocation[0]; // Call var context = new TestWaveConditionsInputContext(waveConditionsInput, Index: Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil/Ringtoets.Revetment.Forms.TestUtil.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -rbda1b9542e899c34dfa695d5e14411a4f52de809 --- Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil/Ringtoets.Revetment.Forms.TestUtil.csproj (.../Ringtoets.Revetment.Forms.TestUtil.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.Forms.TestUtil/Ringtoets.Revetment.Forms.TestUtil.csproj (.../Ringtoets.Revetment.Forms.TestUtil.csproj) (revision bda1b9542e899c34dfa695d5e14411a4f52de809) @@ -34,6 +34,10 @@ {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {87C2C553-C0BC-40BF-B1EA-B83BFF357F27} Ringtoets.Revetment.Data