Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj
===================================================================
diff -u -r2857b234df4622cdaf80bbc75abc58af36667347 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision 2857b234df4622cdaf80bbc75abc58af36667347)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -59,6 +59,14 @@
{3BBFD65B-B277-4E50-AE6D-BD24C3434609}
Core.Common.Base
+
+ {D749EE4C-CE50-4C17-BF01-9A953028C126}
+ Core.Common.TestUtil
+
+
+ {70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2}
+ Ringtoets.HydraRing.Data
+
{D4200F43-3F72-4F42-AF0A-8CED416A38EC}
Ringtoets.Common.Data
Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs
===================================================================
diff -u -re89d90c26d2e93fe5fdc6af469636c702435524e -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision e89d90c26d2e93fe5fdc6af469636c702435524e)
+++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -27,7 +27,6 @@
using Core.Common.TestUtil;
using NUnit.Framework;
using Rhino.Mocks;
-using Ringtoets.Common.Data.TestUtil;
using Ringtoets.Common.Service.MessageProviders;
using Ringtoets.HydraRing.Data;
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs
===================================================================
diff -u -r06b2840a2bb64c0960c8ac29322b5a0971c73c77 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 06b2840a2bb64c0960c8ac29322b5a0971c73c77)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -269,7 +269,7 @@
#endregion
- #region GrassCoverErosionOutwardsWaterLevelLocationsContext TreeNodeInfo
+ #region GrassCoverErosionOutwardsDesignWaterLevelLocationsContext TreeNodeInfo
private ContextMenuStrip GrassCoverErosionOutwardsWaterLevelLocationsContextMenuStrip(GrassCoverErosionOutwardsDesignWaterLevelLocationsContext nodeData, object parentData, TreeViewControl treeViewControl)
{
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj
===================================================================
diff -u -r99e33fe91316f4e40e6caca904a34f23e0439e99 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 99e33fe91316f4e40e6caca904a34f23e0439e99)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -130,10 +130,18 @@
{4843D6E5-066F-4795-94F5-1D53932DD03C}
Ringtoets.Common.Data.TestUtil
+
+ {888d4097-8bc2-4703-9fb1-8744c94d525e}
+ Ringtoets.HydraRing.Calculation
+
{70F8CC9C-5BC8-4FB2-B201-EAE7FA8088C2}
Ringtoets.HydraRing.Data
+
+ {74CBA865-9338-447F-BAD9-28312446AE84}
+ Ringtoets.HydraRing.Calculation.TestUtil
+
{E7225477-577F-4A17-B7EC-6721158E1543}
Ringtoets.GrassCoverErosionOutwards.Data
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs
===================================================================
diff -u -r47b7c14088340aaf95c651898a832da43752c16b -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 47b7c14088340aaf95c651898a832da43752c16b)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -21,6 +21,7 @@
using System;
using System.Drawing;
+using System.IO;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base;
@@ -42,6 +43,7 @@
using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects;
using Ringtoets.GrassCoverErosionOutwards.Forms.Properties;
using Ringtoets.GrassCoverErosionOutwards.Plugin;
+using Ringtoets.HydraRing.Calculation.TestUtil;
using Ringtoets.HydraRing.Data;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources;
@@ -54,6 +56,8 @@
private const int contextMenuRunDesignWaterLevelCalculationsIndex = 0;
private MockRepository mockRepository;
+ private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation");
+
[SetUp]
public void SetUp()
{
@@ -93,7 +97,7 @@
var assessmentSectionMock = mockRepository.StrictMock();
mockRepository.ReplayAll();
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
using (var plugin = new GrassCoverErosionOutwardsPlugin())
@@ -116,7 +120,7 @@
var assessmentSectionMock = mockRepository.StrictMock();
mockRepository.ReplayAll();
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
using (var plugin = new GrassCoverErosionOutwardsPlugin())
{
@@ -144,7 +148,7 @@
TreeNodeInfo info = GetInfo(plugin);
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
var menuBuilder = mockRepository.StrictMock();
@@ -187,7 +191,7 @@
TreeNodeInfo info = GetInfo(plugin);
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
var menuBuilder = new ContextMenuBuilder(applicationFeatureCommandHandler,
@@ -252,7 +256,7 @@
TreeNodeInfo info = GetInfo(plugin);
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
var menuBuilder = new ContextMenuBuilder(applicationFeatureCommandHandler,
@@ -337,7 +341,7 @@
var assessmentSectionMock = mockRepository.Stub();
mockRepository.ReplayAll();
var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(
- new ObservableList(),
+ new ObservableList(),
assessmentSectionMock);
using (var plugin = new GrassCoverErosionOutwardsPlugin())
{
@@ -364,11 +368,6 @@
var hydraulicBoundaryLocation2 = new HydraulicBoundaryLocation(100002, "", 3.3, 4.4);
var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
{
- Locations =
- {
- hydraulicBoundaryLocation1,
- hydraulicBoundaryLocation2
- },
FilePath = "D:/nonExistingDirectory/nonExistingFile"
};
@@ -432,6 +431,76 @@
mockRepository.VerifyAll();
}
+ [Test]
+ [RequiresSTA]
+ public void GivenHydraulicBoundaryLocationThatFails_CalculatingDesignWaterLevelFromContextMenu_ThenLogMessagesAddedPreviousOutputNotAffected()
+ {
+ // Given
+ var guiMock = mockRepository.DynamicMock();
+
+ var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ FilePath = Path.Combine(testDataPath, "HRD ijsselmeer.sqlite")
+ };
+
+ var assessmentSectionMock = mockRepository.Stub();
+ assessmentSectionMock.Expect(a => a.Id).Return("Id");
+ assessmentSectionMock.Expect(a => a.GetFailureMechanisms()).Return(new[]
+ {
+ new GrassCoverErosionOutwardsFailureMechanism
+ {
+ Contribution = 1
+ }
+ });
+ assessmentSectionMock.Expect(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 300));
+ assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase;
+
+ const string locationName = "HRbasis_ijsslm_1000";
+ var location = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(
+ new HydraulicBoundaryLocation(700002, locationName, 1.1, 2.2));
+ var grassCoverErosionOutwardsHydraulicBoundaryLocations = new ObservableList
+ {
+ location
+ };
+ var context = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContext(grassCoverErosionOutwardsHydraulicBoundaryLocations, assessmentSectionMock);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ guiMock.Expect(g => g.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ guiMock.Expect(g => g.MainWindow).Return(mockRepository.Stub());
+ mockRepository.ReplayAll();
+
+ using (var plugin = new GrassCoverErosionOutwardsPlugin())
+ {
+ TreeNodeInfo info = GetInfo(plugin);
+ plugin.Gui = guiMock;
+ plugin.Activate();
+
+ using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl))
+ using (new HydraRingCalculationServiceConfig())
+ {
+ // When
+ Action action = () => { contextMenuAdapter.Items[contextMenuRunDesignWaterLevelCalculationsIndex].PerformClick(); };
+
+ // Then
+ TestHelper.AssertLogMessages(action, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(6, msgs.Length);
+ StringAssert.StartsWith(string.Format("Validatie van 'Waterstand bij doorsnede-eis voor locatie {0}' gestart om:", locationName), msgs[0]);
+ StringAssert.StartsWith(string.Format("Validatie van 'Waterstand bij doorsnede-eis voor locatie {0}' beëindigd om:", locationName), msgs[1]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Waterstand bij doorsnede-eis voor locatie {0}' gestart om:", locationName), msgs[2]);
+ StringAssert.StartsWith(string.Format("Er is een fout opgetreden tijdens de Waterstand bij doorsnede-eis berekening '{0}': inspecteer het logbestand.", locationName), msgs[3]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Waterstand bij doorsnede-eis voor locatie {0}' beëindigd om:", locationName), msgs[4]);
+ StringAssert.StartsWith(string.Format("Uitvoeren van 'Waterstand bij doorsnede-eis berekenen voor locatie '{0}'' is mislukt.", locationName), msgs[5]);
+ });
+ Assert.AreEqual(CalculationConvergence.NotCalculated, location.DesignWaterLevelCalculationConvergence);
+ }
+ }
+ }
+ mockRepository.VerifyAll();
+ }
+
private static TreeNodeInfo GetInfo(GrassCoverErosionOutwardsPlugin plugin)
{
return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionOutwardsDesignWaterLevelLocationsContext));
Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/MessageProviders/DesignWaterLevelCalculationMessageProvider.cs
===================================================================
diff -u -r06b2840a2bb64c0960c8ac29322b5a0971c73c77 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Integration/src/Ringtoets.Integration.Service/MessageProviders/DesignWaterLevelCalculationMessageProvider.cs (.../DesignWaterLevelCalculationMessageProvider.cs) (revision 06b2840a2bb64c0960c8ac29322b5a0971c73c77)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Service/MessageProviders/DesignWaterLevelCalculationMessageProvider.cs (.../DesignWaterLevelCalculationMessageProvider.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -31,7 +31,7 @@
{
public string GetCalculationName(string locationName)
{
- return string.Format(Resources.DesignWaterLevelCalculationService_Name_Assessment_level_for_location_0_, locationName);
+ return string.Format(Resources.DesignWaterLevelCalculationService_Name_Calculate_assessment_level_for_location_0_, locationName);
}
public string GetActivityName(string locationName)
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj
===================================================================
diff -u -r944d2501b3f780d208e00015a1b850afad4c3aa8 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 944d2501b3f780d208e00015a1b850afad4c3aa8)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -190,6 +190,10 @@
{318ba582-88c9-4816-a54a-a7e431461de3}
Core.Components.Gis
+
+ {74CBA865-9338-447F-BAD9-28312446AE84}
+ Ringtoets.HydraRing.Calculation.TestUtil
+
{567E0B69-5280-41CE-ADD6-443725A61C86}
Ringtoets.WaveImpactAsphaltCover.Data
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs
===================================================================
diff -u -rff8a088931e6af2e46f6f4f09b633bcdd0b84ecd -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision ff8a088931e6af2e46f6f4f09b633bcdd0b84ecd)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -21,6 +21,7 @@
using System;
using System.Drawing;
+using System.IO;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base.Data;
@@ -36,6 +37,7 @@
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.HydraRing.Calculation.TestUtil;
using Ringtoets.HydraRing.Data;
using Ringtoets.Integration.Data;
using Ringtoets.Integration.Forms.PresentationObjects;
@@ -49,6 +51,7 @@
{
private const int contextMenuRunAssessmentLevelCalculationsIndex = 1;
private MockRepository mockRepository;
+ private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation");
[SetUp]
public void SetUp()
@@ -341,6 +344,72 @@
mockRepository.VerifyAll();
}
+ [Test]
+ [RequiresSTA]
+ public void GivenHydraulicBoundaryLocationThatFails_CalculatingAssessmentLevelFromContextMenu_ThenLogMessagesAddedPreviousOutputNotAffected()
+ {
+ // Given
+ var guiMock = mockRepository.DynamicMock();
+
+ const string locationName = "locationName";
+ var location = new HydraulicBoundaryLocation(1, locationName, 1.1, 2.2);
+ var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike)
+ {
+ HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ Locations =
+ {
+ location
+ },
+ FilePath = Path.Combine(testDataPath, "HRD ijsselmeer.sqlite")
+ }
+ };
+
+ var context = new DesignWaterLevelLocationsContext(assessmentSection);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ guiMock.Expect(g => g.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ guiMock.Expect(g => g.MainWindow).Return(mockRepository.Stub());
+ guiMock.Expect(g => g.DocumentViewController).Return(mockRepository.Stub());
+ mockRepository.ReplayAll();
+
+ DialogBoxHandler = (name, wnd) =>
+ {
+ // Expect an activity dialog which is automatically closed
+ };
+
+ using (var plugin = new RingtoetsPlugin())
+ {
+ TreeNodeInfo info = GetInfo(plugin);
+ plugin.Gui = guiMock;
+ plugin.Activate();
+
+ using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl))
+ using (new HydraRingCalculationServiceConfig())
+ {
+ // When
+ Action action = () => { contextMenuAdapter.Items[contextMenuRunAssessmentLevelCalculationsIndex].PerformClick(); };
+
+ // Then
+ TestHelper.AssertLogMessages(action, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(6, msgs.Length);
+ StringAssert.StartsWith(string.Format("Validatie van 'Toetspeil berekenen voor locatie '{0}'' gestart om:", locationName), msgs[0]);
+ StringAssert.StartsWith(string.Format("Validatie van 'Toetspeil berekenen voor locatie '{0}'' beëindigd om:", locationName), msgs[1]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Toetspeil berekenen voor locatie '{0}'' gestart om:", locationName), msgs[2]);
+ StringAssert.StartsWith(string.Format("Er is een fout opgetreden tijdens de toetspeil berekening '{0}': inspecteer het logbestand.", locationName), msgs[3]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Toetspeil berekenen voor locatie '{0}'' beëindigd om:", locationName), msgs[4]);
+ StringAssert.StartsWith(string.Format("Uitvoeren van 'Toetspeil berekenen voor locatie '{0}'' is mislukt.", locationName), msgs[5]);
+ });
+ Assert.AreEqual(CalculationConvergence.NotCalculated, location.DesignWaterLevelCalculationConvergence);
+ }
+ }
+ }
+ mockRepository.VerifyAll();
+ }
+
private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin)
{
return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DesignWaterLevelLocationsContext));
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs
===================================================================
diff -u -rff8a088931e6af2e46f6f4f09b633bcdd0b84ecd -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision ff8a088931e6af2e46f6f4f09b633bcdd0b84ecd)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -21,6 +21,7 @@
using System;
using System.Drawing;
+using System.IO;
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base.Data;
@@ -36,6 +37,7 @@
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.HydraRing.Calculation.TestUtil;
using Ringtoets.HydraRing.Data;
using Ringtoets.Integration.Data;
using Ringtoets.Integration.Forms.PresentationObjects;
@@ -50,6 +52,8 @@
private const int contextMenuRunWaveHeightCalculationsIndex = 1;
private MockRepository mockRepository;
+ private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation");
+
[SetUp]
public void SetUp()
{
@@ -346,6 +350,72 @@
mockRepository.VerifyAll();
}
+ [Test]
+ [RequiresSTA]
+ public void GivenHydraulicBoundaryLocationThatFails_CalculatingWaveHeightFromContextMenu_ThenLogMessagesAddedPreviousOutputNotAffected()
+ {
+ // Given
+ var guiMock = mockRepository.DynamicMock();
+
+ const string locationName = "locationName";
+ var location = new HydraulicBoundaryLocation(1, locationName, 1.1, 2.2);
+ var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike)
+ {
+ HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ Locations =
+ {
+ location
+ },
+ FilePath = Path.Combine(testDataPath, "HRD ijsselmeer.sqlite")
+ }
+ };
+
+ var context = new WaveHeightLocationsContext(assessmentSection);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ guiMock.Expect(g => g.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ guiMock.Expect(g => g.MainWindow).Return(mockRepository.Stub());
+ guiMock.Expect(g => g.DocumentViewController).Return(mockRepository.Stub());
+ mockRepository.ReplayAll();
+
+ DialogBoxHandler = (name, wnd) =>
+ {
+ // Expect an activity dialog which is automatically closed
+ };
+
+ using (var plugin = new RingtoetsPlugin())
+ {
+ TreeNodeInfo info = GetInfo(plugin);
+ plugin.Gui = guiMock;
+ plugin.Activate();
+
+ using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl))
+ using (new HydraRingCalculationServiceConfig())
+ {
+ // When
+ Action action = () => { contextMenuAdapter.Items[contextMenuRunWaveHeightCalculationsIndex].PerformClick(); };
+
+ // Then
+ TestHelper.AssertLogMessages(action, messages =>
+ {
+ var msgs = messages.ToArray();
+ Assert.AreEqual(6, msgs.Length);
+ StringAssert.StartsWith(string.Format("Validatie van 'Golfhoogte berekenen voor locatie '{0}'' gestart om:", locationName), msgs[0]);
+ StringAssert.StartsWith(string.Format("Validatie van 'Golfhoogte berekenen voor locatie '{0}'' beëindigd om:", locationName), msgs[1]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Golfhoogte berekenen voor locatie '{0}'' gestart om:", locationName), msgs[2]);
+ StringAssert.StartsWith(string.Format("Er is een fout opgetreden tijdens de golfhoogte berekening '{0}': inspecteer het logbestand.", locationName), msgs[3]);
+ StringAssert.StartsWith(string.Format("Berekening van 'Golfhoogte berekenen voor locatie '{0}'' beëindigd om:", locationName), msgs[4]);
+ StringAssert.StartsWith(string.Format("Uitvoeren van 'Golfhoogte berekenen voor locatie '{0}'' is mislukt.", locationName), msgs[5]);
+ });
+ Assert.AreEqual(CalculationConvergence.NotCalculated, location.WaveHeightCalculationConvergence);
+ }
+ }
+ }
+ mockRepository.VerifyAll();
+ }
+
private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin)
{
return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveHeightLocationsContext));
Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/MessageProviders/DesignWaterLevelCalculationMessageProviderTest.cs
===================================================================
diff -u -r06b2840a2bb64c0960c8ac29322b5a0971c73c77 -rc399d2d0b6ce75c643c256bf605b748fc1dea88b
--- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/MessageProviders/DesignWaterLevelCalculationMessageProviderTest.cs (.../DesignWaterLevelCalculationMessageProviderTest.cs) (revision 06b2840a2bb64c0960c8ac29322b5a0971c73c77)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/MessageProviders/DesignWaterLevelCalculationMessageProviderTest.cs (.../DesignWaterLevelCalculationMessageProviderTest.cs) (revision c399d2d0b6ce75c643c256bf605b748fc1dea88b)
@@ -52,7 +52,7 @@
var calculationName = provider.GetCalculationName(name);
// Assert
- var expectedName = string.Format(Resources.DesignWaterLevelCalculationService_Name_Assessment_level_for_location_0_, name);
+ var expectedName = string.Format(Resources.DesignWaterLevelCalculationService_Name_Calculate_assessment_level_for_location_0_, name);
Assert.AreEqual(expectedName, calculationName);
}