Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapViewTestHelperTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapViewTestHelperTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/MapViewTestHelperTest.cs (revision 96759fa65dbec95ff2cb8eab5f562059da22e0b8) @@ -0,0 +1,78 @@ +// 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.Linq; +using NUnit.Framework; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; + +namespace Ringtoets.Common.Forms.TestUtil.Test +{ + [TestFixture] + public class MapViewTestHelperTest + { + [Test] + public void GetCalculationFuncs_Always_ReturnsExpectedCases() + { + // Setup + var assessmentSection = new ObservableTestAssessmentSectionStub(); + assessmentSection.AddHydraulicBoundaryLocation(new HydraulicBoundaryLocation(1, "test", 2, 3)); + + // Call + TestCaseData[] cases = MapViewTestHelper.GetCalculationFuncs.ToArray(); + + // Assert + var expectedCases = new[] + { + new TestCaseData(new Func( + a => a.WaterLevelCalculationsForFactorizedSignalingNorm.First())), + new TestCaseData(new Func( + a => assessmentSection.WaterLevelCalculationsForSignalingNorm.First())), + new TestCaseData(new Func( + a => a.WaterLevelCalculationsForLowerLimitNorm.First())), + new TestCaseData(new Func( + a => a.WaterLevelCalculationsForFactorizedLowerLimitNorm.First())), + new TestCaseData(new Func( + a => a.WaveHeightCalculationsForFactorizedSignalingNorm.First())), + new TestCaseData(new Func( + a => a.WaveHeightCalculationsForSignalingNorm.First())), + new TestCaseData(new Func( + a => a.WaveHeightCalculationsForLowerLimitNorm.First())), + new TestCaseData(new Func( + a => a.WaveHeightCalculationsForFactorizedLowerLimitNorm.First())) + }; + + Assert.AreEqual(expectedCases.Length, cases.Length); + for (var i = 0; i < expectedCases.Length; i++) + { + var expectedFunc = (Func) expectedCases[i].Arguments[0]; + HydraulicBoundaryLocationCalculation expectedFuncOutput = expectedFunc(assessmentSection); + + var actualFunc = (Func) cases[i].Arguments[0]; + HydraulicBoundaryLocationCalculation actualFuncOutput = actualFunc(assessmentSection); + + Assert.AreSame(expectedFuncOutput, actualFuncOutput); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj =================================================================== diff -u -reafd42ded45d3c8c39100bc5318562f734af0302 -r96759fa65dbec95ff2cb8eab5f562059da22e0b8 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj (.../Ringtoets.Common.Forms.TestUtil.Test.csproj) (revision eafd42ded45d3c8c39100bc5318562f734af0302) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil.Test/Ringtoets.Common.Forms.TestUtil.Test.csproj (.../Ringtoets.Common.Forms.TestUtil.Test.csproj) (revision 96759fa65dbec95ff2cb8eab5f562059da22e0b8) @@ -18,6 +18,7 @@ + @@ -62,6 +63,10 @@ {420ED9C3-0C33-47EA-B893-121A9C0DB4F1} Ringtoets.AssemblyTool.Data + + {96C8FDAE-9F59-4D2F-A66E-BE512BB5EECB} + Ringtoets.Integration.Forms.Test + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapViewTestHelper.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapViewTestHelper.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/MapViewTestHelper.cs (revision 96759fa65dbec95ff2cb8eab5f562059da22e0b8) @@ -0,0 +1,63 @@ +// 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 Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Hydraulics; + +namespace Ringtoets.Common.Forms.TestUtil +{ + /// + /// Helper class for map views. + /// + public static class MapViewTestHelper + { + /// + /// Gets a collection of test cases to test map view updating logic regarding + /// . + /// + public static IEnumerable GetCalculationFuncs + { + get + { + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaterLevelCalculationsForSignalingNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaveHeightCalculationsForFactorizedSignalingNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaveHeightCalculationsForSignalingNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaveHeightCalculationsForLowerLimitNorm.First())); + yield return new TestCaseData(new Func( + assessmentSection => assessmentSection.WaveHeightCalculationsForFactorizedLowerLimitNorm.First())); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj =================================================================== diff -u -r682dfada6e821a0dd7cf3f6be9a2823eb72d9302 -r96759fa65dbec95ff2cb8eab5f562059da22e0b8 --- Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj (.../Ringtoets.Common.Forms.TestUtil.csproj) (revision 682dfada6e821a0dd7cf3f6be9a2823eb72d9302) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.TestUtil/Ringtoets.Common.Forms.TestUtil.csproj (.../Ringtoets.Common.Forms.TestUtil.csproj) (revision 96759fa65dbec95ff2cb8eab5f562059da22e0b8) @@ -20,6 +20,7 @@ +