Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.Designer.cs
===================================================================
diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.Designer.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.Designer.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.Designer.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.Designer.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -23,24 +23,6 @@
{
partial class GrassCoverErosionInwardsDikeProfileSelectionDialog
{
- ///
- /// Required designer variable.
- ///
- private System.ComponentModel.IContainer components = null;
-
- ///
- /// Clean up any resources being used.
- ///
- /// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- }
- base.Dispose(disposing);
- }
-
#region Windows Form Designer generated code
///
@@ -50,48 +32,17 @@
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GrassCoverErosionInwardsDikeProfileSelectionDialog));
- this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
- this.OkButton = new System.Windows.Forms.Button();
- this.CustomCancelButton = new System.Windows.Forms.Button();
- this.flowLayoutPanel1.SuspendLayout();
this.SuspendLayout();
//
- // flowLayoutPanel1
- //
- this.flowLayoutPanel1.Controls.Add(this.CustomCancelButton);
- this.flowLayoutPanel1.Controls.Add(this.OkButton);
- resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1");
- this.flowLayoutPanel1.Name = "flowLayoutPanel1";
- //
- // OkButton
- //
- resources.ApplyResources(this.OkButton, "OkButton");
- this.OkButton.Name = "OkButton";
- this.OkButton.UseVisualStyleBackColor = true;
- this.OkButton.Click += new System.EventHandler(this.OkButtonOnClick);
- //
- // CancelButton
- //
- resources.ApplyResources(this.CustomCancelButton, "CustomCancelButton");
- this.CustomCancelButton.Name = "CustomCancelButton";
- this.CustomCancelButton.UseVisualStyleBackColor = true;
- this.CustomCancelButton.Click += new System.EventHandler(this.CancelButtonOnClick);
- //
// DikeProfileSelectionDialog
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.Controls.Add(this.flowLayoutPanel1);
this.Name = "DikeProfileSelectionDialog";
- this.flowLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
-
- private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
- private System.Windows.Forms.Button CustomCancelButton;
- private System.Windows.Forms.Button OkButton;
}
}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.cs
===================================================================
diff -u -r9a196c8bc554a2e97ff094d7ffb2e99c42eb04fd -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.cs) (revision 9a196c8bc554a2e97ff094d7ffb2e99c42eb04fd)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -21,61 +21,39 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Windows.Forms;
-using Core.Common.Controls.Dialogs;
using Ringtoets.Common.Data.DikeProfiles;
-using Ringtoets.GrassCoverErosionInwards.Forms.Views;
-using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+using Ringtoets.Common.Forms;
+using Ringtoets.Common.Forms.Views;
+using Ringtoets.GrassCoverErosionInwards.Forms.Properties;
namespace Ringtoets.GrassCoverErosionInwards.Forms
{
///
/// A dialog which allows the user to make a selection form a given set of . Upon
/// closing of the dialog, the selected can be obtained.
///
- public partial class GrassCoverErosionInwardsDikeProfileSelectionDialog : DialogBase
+ public partial class GrassCoverErosionInwardsDikeProfileSelectionDialog : SelectionDialogBase
{
///
/// Creates a new instance of .
///
/// The parent of the dialog.
/// The collection of to show in the dialog.
+ /// Thrown when any parameter is null.
public GrassCoverErosionInwardsDikeProfileSelectionDialog(IWin32Window dialogParent, IEnumerable dikeProfiles)
- : base(dialogParent, RingtoetsCommonFormsResources.GenerateScenariosIcon, 300, 400)
+ : base(dialogParent)
{
- InitializeComponent();
-
- DikeProfileSelectionView = new GrassCoverErosionInwardsDikeProfileSelectionView(dikeProfiles)
+ if (dikeProfiles == null)
{
- Dock = DockStyle.Fill
- };
- Controls.Add(DikeProfileSelectionView);
- SelectedDikeProfiles = new List();
- }
+ throw new ArgumentNullException("dikeProfiles");
+ }
- ///
- /// Gets a collection of selected if they were selected
- /// in the dialog and a confirmation was given. If no confirmation was given or no
- /// was selected, then an empty collection is returned.
- ///
- public IEnumerable SelectedDikeProfiles { get; private set; }
+ InitializeComponent();
+ InitializeDataGridView(Resources.DikeProfile_DisplayName);
- protected override Button GetCancelButton()
- {
- return CustomCancelButton;
+ SetDataSource(dikeProfiles.Select(p => new SelectableRow(p, p.Name)).ToArray());
}
-
- private GrassCoverErosionInwardsDikeProfileSelectionView DikeProfileSelectionView { get; set; }
-
- private void OkButtonOnClick(object sender, EventArgs e)
- {
- SelectedDikeProfiles = DikeProfileSelectionView.GetSelectedDikeProfiles();
- Close();
- }
-
- private void CancelButtonOnClick(object sender, EventArgs eventArgs)
- {
- Close();
- }
}
}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.resx
===================================================================
diff -u -r7d790a82bda0347f47961162de614bacfa8e288c -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.resx (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.resx) (revision 7d790a82bda0347f47961162de614bacfa8e288c)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/GrassCoverErosionInwardsDikeProfileSelectionDialog.resx (.../GrassCoverErosionInwardsDikeProfileSelectionDialog.resx) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -128,21 +128,6 @@
1
-
- Annuleren
-
-
- CustomCancelButton
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanel1
-
-
- 0
-
212, 3
@@ -152,21 +137,6 @@
0
-
- Genereren
-
-
- OkButton
-
-
- System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- flowLayoutPanel1
-
-
- 1
-
Bottom
@@ -183,18 +153,6 @@
0
-
- flowLayoutPanel1
-
-
- System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- $this
-
-
- 0
-
True
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj
===================================================================
diff -u -r3e5a3e2990566fe86caaaa87136d0f57543a9666 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision 3e5a3e2990566fe86caaaa87136d0f57543a9666)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Ringtoets.GrassCoverErosionInwards.Forms.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.csproj) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -77,12 +77,6 @@
UserControl
-
- UserControl
-
-
- GrassCoverErosionInwardsDikeProfileSelectionView.cs
-
UserControl
@@ -173,9 +167,6 @@
Resources.Designer.cs
Designer
-
- GrassCoverErosionInwardsDikeProfileSelectionView.cs
-
GrassCoverErosionInwardsInputView.cs
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsDikeProfileSelectionView.Designer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsDikeProfileSelectionView.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsDikeProfileSelectionView.resx'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs
===================================================================
diff -u -rd2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision d2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -514,7 +514,7 @@
using (var view = new GrassCoverErosionInwardsDikeProfileSelectionDialog(Gui.MainWindow, nodeData.AvailableDikeProfiles))
{
view.ShowDialog();
- GenerateCalculations(nodeData.WrappedData, nodeData.FailureMechanism, view.SelectedDikeProfiles);
+ GenerateCalculations(nodeData.WrappedData, nodeData.FailureMechanism, view.SelectedItems);
}
nodeData.NotifyObservers();
}
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs
===================================================================
diff -u -r30b8231f92b90ea4b05e98e3d0285368f6dfe2e4 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision 30b8231f92b90ea4b05e98e3d0285368f6dfe2e4)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -23,16 +23,20 @@
using System.Linq;
using System.Windows.Forms;
using Core.Common.Base.Geometry;
+using Core.Common.Controls.DataGrid;
using NUnit.Extensions.Forms;
using NUnit.Framework;
using Ringtoets.Common.Data.DikeProfiles;
-using Ringtoets.GrassCoverErosionInwards.Forms.Views;
+using Ringtoets.Common.Forms;
namespace Ringtoets.GrassCoverErosionInwards.Forms.Test
{
[TestFixture]
public class GrassCoverErosionInwardsDikeProfileSelectionDialogTest
{
+ private const int locationSelectionColumnIndex = 0;
+ private const int locationColumnIndex = 1;
+
[Test]
public void Constructor_WithoutParent_ThrowsArgumentNullException()
{
@@ -69,119 +73,74 @@
using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, Enumerable.Empty()))
{
// Assert
- Assert.IsEmpty(dialog.SelectedDikeProfiles);
- Assert.IsInstanceOf(new ControlTester("GrassCoverErosionInwardsDikeProfileSelectionView", dialog).TheObject);
+ Assert.IsInstanceOf>(dialog);
+ Assert.IsEmpty(dialog.SelectedItems);
Assert.AreEqual("Selecteer dijkprofielen", dialog.Text);
}
}
}
[Test]
- public void OnLoad_Always_SetMinimumSize()
+ public void Constructor_DataGridViewCorrectlyInitialized()
{
- // Setup
+ // Setup & Call
using (var viewParent = new Form())
using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, Enumerable.Empty()))
{
- // Call
dialog.Show();
// Assert
- Assert.AreEqual(300, dialog.MinimumSize.Width);
- Assert.AreEqual(400, dialog.MinimumSize.Height);
- }
- }
+ Assert.IsEmpty(dialog.SelectedItems);
- [Test]
- public void GivenDialogWithSelectedDikeProfiles_WhenCloseWithoutConfirmation_ThenReturnsEmptyCollection()
- {
- // Given
- var dikeProfiles = new[]
- {
- CreateDikeProfile(),
- CreateDikeProfile()
- };
+ var dataGridViewControl = (DataGridViewControl)new ControlTester("DataGridViewControl", dialog).TheObject;
+ var dataGridView = dataGridViewControl.Controls.OfType().First();
+ Assert.AreEqual(2, dataGridView.ColumnCount);
- using (var viewParent = new Form())
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, dikeProfiles))
- {
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
+ var locationCalculateColumn = (DataGridViewCheckBoxColumn)dataGridView.Columns[locationSelectionColumnIndex];
+ const string expectedLocationCalculateHeaderText = "Gebruik";
+ Assert.AreEqual(expectedLocationCalculateHeaderText, locationCalculateColumn.HeaderText);
+ Assert.AreEqual("Selected", locationCalculateColumn.DataPropertyName);
+ Assert.IsFalse(locationCalculateColumn.ReadOnly);
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
-
- // When
- dialog.Close();
-
- // Then
- Assert.IsEmpty(dialog.SelectedDikeProfiles);
+ var nameColumn = (DataGridViewTextBoxColumn)dataGridView.Columns[locationColumnIndex];
+ const string expectedNameHeaderText = "Dijkprofiel";
+ Assert.AreEqual(expectedNameHeaderText, nameColumn.HeaderText);
+ Assert.AreEqual("Name", nameColumn.DataPropertyName);
+ Assert.AreEqual(DataGridViewAutoSizeColumnMode.Fill, nameColumn.AutoSizeMode);
+ Assert.IsTrue(nameColumn.ReadOnly);
}
}
[Test]
- public void GivenDialogWithSelectedDikeProfiles_WhenCancelButtonClicked_ThenReturnsSelectedCollection()
+ public void Constructor_HydraulicBoundaryLocationOneEntry_OneRowInGrid()
{
- // Given
- var selectedDikeProfile = CreateDikeProfile();
- var dikeProfiles = new[]
- {
- selectedDikeProfile,
- CreateDikeProfile()
- };
+ // Setup
+ const string testname = "testName";
+ // Call
using (var viewParent = new Form())
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, dikeProfiles))
+ using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, new[]
{
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
-
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
-
- // When
- var cancelButton = new ButtonTester("CustomCancelButton", dialog);
- cancelButton.Click();
-
- // Then
- Assert.IsEmpty(dialog.SelectedDikeProfiles);
- }
- }
-
- [Test]
- public void GivenDialogWithSelectedDikeProfiles_WhenGenerateButtonClicked_ThenReturnsSelectedCollection()
- {
- // Given
- var selectedDikeProfile = CreateDikeProfile();
- var dikeProfiles = new[]
+ CreateDikeProfile(testname)
+ }))
{
- selectedDikeProfile,
- CreateDikeProfile()
- };
-
- using (var viewParent = new Form())
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, dikeProfiles))
- {
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
-
+ // Assert
dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
- // When
- var okButton = new ButtonTester("OkButton", dialog);
- okButton.Click();
-
- // Then
- var result = dialog.SelectedDikeProfiles;
- CollectionAssert.AreEqual(new[]
- {
- selectedDikeProfile
- }, result);
+ var dataGridViewControl = (DataGridViewControl)new ControlTester("DataGridViewControl").TheObject;
+ Assert.AreEqual(1, dataGridViewControl.Rows.Count);
+ Assert.IsFalse((bool)dataGridViewControl.Rows[0].Cells[locationSelectionColumnIndex].Value);
+ Assert.AreEqual(testname, (string)dataGridViewControl.Rows[0].Cells[locationColumnIndex].Value);
}
}
- private DikeProfile CreateDikeProfile()
+ private static DikeProfile CreateDikeProfile(string name)
{
return new DikeProfile(new Point2D(0, 0), new RoughnessPoint[0], new Point2D[0],
- null, new DikeProfile.ConstructionProperties());
+ null, new DikeProfile.ConstructionProperties
+ {
+ Name = name
+ });
}
}
}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj
===================================================================
diff -u -rd2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision d2b9feaf8aceaa9a96d0e6e19fd6fbbee8987ca6)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -92,7 +92,6 @@
-
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs
===================================================================
diff -u -r915001caffacbbee15c0e3bf449072245bc5f509 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 915001caffacbbee15c0e3bf449072245bc5f509)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -24,6 +24,7 @@
using System.Windows.Forms;
using Core.Common.Base;
using Core.Common.Base.Geometry;
+using Core.Common.Controls.DataGrid;
using Core.Common.Controls.TreeView;
using Core.Common.Gui;
using Core.Common.Gui.Commands;
@@ -160,12 +161,12 @@
// Assert
Assert.AreEqual(group.Children.Count, children.Length);
- var calculationGroupContext = (GrassCoverErosionInwardsCalculationGroupContext) children[0];
+ var calculationGroupContext = (GrassCoverErosionInwardsCalculationGroupContext)children[0];
Assert.AreSame(childGroup, calculationGroupContext.WrappedData);
Assert.AreSame(failureMechanism, calculationGroupContext.FailureMechanism);
Assert.AreSame(assessmentSectionMock, calculationGroupContext.AssessmentSection);
Assert.AreSame(calculationItemMock, children[1]);
- var calculationContext = (GrassCoverErosionInwardsCalculationContext) children[2];
+ var calculationContext = (GrassCoverErosionInwardsCalculationContext)children[2];
Assert.AreSame(childCalculation, calculationContext.WrappedData);
Assert.AreSame(assessmentSectionMock, calculationContext.AssessmentSection);
}
@@ -236,39 +237,39 @@
// Call
using (ContextMenuStrip menu = info.ContextMenuStrip(groupContext, null, treeViewControl))
{
- // Assert
- Assert.AreEqual(12, menu.Items.Count);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexRootGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup_Tooltip,
- RingtoetsCommonFormsResources.AddFolderIcon);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexRootGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation,
- RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation_Tooltip,
- RingtoetsCommonFormsResources.FailureMechanismIcon);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRemoveAllChildrenRootGroupIndex,
- RingtoetsCommonFormsResources.CalculationGroup_RemoveAllChildrenFromGroup_Remove_all,
- RingtoetsCommonFormsResources.CalculationGroup_RemoveAllChildrenFromGroup_No_Calculation_or_Group_to_remove,
- RingtoetsCommonFormsResources.RemoveAllIcon,
- false);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexRootGroup,
- RingtoetsCommonFormsResources.Validate_all,
- RingtoetsCommonFormsResources.ValidateAll_No_calculations_to_validate,
- RingtoetsCommonFormsResources.ValidateAllIcon,
- false);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
- RingtoetsCommonFormsResources.Calculate_all,
- RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_No_calculations_to_run,
- RingtoetsCommonFormsResources.CalculateAllIcon,
- false);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearAllIndexRootGroup,
- RingtoetsCommonFormsResources.Clear_all_output,
- RingtoetsCommonFormsResources.CalculationGroup_ClearOutput_No_calculation_with_output_to_clear,
- RingtoetsCommonFormsResources.ClearIcon,
- false);
+ // Assert
+ Assert.AreEqual(12, menu.Items.Count);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexRootGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup_Tooltip,
+ RingtoetsCommonFormsResources.AddFolderIcon);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexRootGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation_Tooltip,
+ RingtoetsCommonFormsResources.FailureMechanismIcon);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRemoveAllChildrenRootGroupIndex,
+ RingtoetsCommonFormsResources.CalculationGroup_RemoveAllChildrenFromGroup_Remove_all,
+ RingtoetsCommonFormsResources.CalculationGroup_RemoveAllChildrenFromGroup_No_Calculation_or_Group_to_remove,
+ RingtoetsCommonFormsResources.RemoveAllIcon,
+ false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Validate_all,
+ RingtoetsCommonFormsResources.ValidateAll_No_calculations_to_validate,
+ RingtoetsCommonFormsResources.ValidateAllIcon,
+ false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Calculate_all,
+ RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_No_calculations_to_run,
+ RingtoetsCommonFormsResources.CalculateAllIcon,
+ false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Clear_all_output,
+ RingtoetsCommonFormsResources.CalculationGroup_ClearOutput_No_calculation_with_output_to_clear,
+ RingtoetsCommonFormsResources.ClearIcon,
+ false);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_NestedCalculationGroup_CallsContextMenuBuilderMethods()
@@ -338,36 +339,36 @@
// Call
using (ContextMenuStrip menu = info.ContextMenuStrip(groupContext, parentGroupContext, treeViewControl))
{
- // Assert
- Assert.AreEqual(9, menu.Items.Count);
+ // Assert
+ Assert.AreEqual(9, menu.Items.Count);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexNestedGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup_Tooltip,
- RingtoetsCommonFormsResources.AddFolderIcon);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexNestedGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation,
- RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation_Tooltip,
- RingtoetsCommonFormsResources.FailureMechanismIcon);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndexNestedGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup_Tooltip,
+ RingtoetsCommonFormsResources.AddFolderIcon);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndexNestedGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation,
+ RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation_Tooltip,
+ RingtoetsCommonFormsResources.FailureMechanismIcon);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexNestedGroup,
- RingtoetsCommonFormsResources.Validate_all,
- RingtoetsCommonFormsResources.ValidateAll_No_calculations_to_validate,
- RingtoetsCommonFormsResources.ValidateAllIcon,
- false);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexNestedGroup,
- RingtoetsCommonFormsResources.Calculate_all,
- RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_No_calculations_to_run,
- RingtoetsCommonFormsResources.CalculateAllIcon,
- false);
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearAllIndexNestedGroup,
- RingtoetsCommonFormsResources.Clear_all_output,
- RingtoetsCommonFormsResources.CalculationGroup_ClearOutput_No_calculation_with_output_to_clear,
- RingtoetsCommonFormsResources.ClearIcon,
- false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndexNestedGroup,
+ RingtoetsCommonFormsResources.Validate_all,
+ RingtoetsCommonFormsResources.ValidateAll_No_calculations_to_validate,
+ RingtoetsCommonFormsResources.ValidateAllIcon,
+ false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexNestedGroup,
+ RingtoetsCommonFormsResources.Calculate_all,
+ RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_No_calculations_to_run,
+ RingtoetsCommonFormsResources.CalculateAllIcon,
+ false);
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearAllIndexNestedGroup,
+ RingtoetsCommonFormsResources.Clear_all_output,
+ RingtoetsCommonFormsResources.CalculationGroup_ClearOutput_No_calculation_with_output_to_clear,
+ RingtoetsCommonFormsResources.ClearIcon,
+ false);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_NoFailureMechanismSections_ContextMenuItemCalculateAllDisabledAndTooltipSet()
@@ -408,15 +409,15 @@
// Call
using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
- RingtoetsCommonFormsResources.Calculate_all,
- RingtoetsCommonFormsResources.Plugin_AllDataAvailable_No_failure_mechanism_sections_imported,
- RingtoetsCommonFormsResources.CalculateAllIcon,
- false);
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Calculate_all,
+ RingtoetsCommonFormsResources.Plugin_AllDataAvailable_No_failure_mechanism_sections_imported,
+ RingtoetsCommonFormsResources.CalculateAllIcon,
+ false);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_FailureMechanismSectionsSetNoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllDisabledAndTooltipSet()
@@ -464,15 +465,15 @@
// Call
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuCalculateAllIndexRootGroup,
- RingtoetsCommonFormsResources.Calculate_all,
- RingtoetsCommonFormsResources.Plugin_AllDataAvailable_No_hydraulic_boundary_database_imported,
- RingtoetsCommonFormsResources.CalculateAllIcon,
- false);
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuCalculateAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Calculate_all,
+ RingtoetsCommonFormsResources.Plugin_AllDataAvailable_No_hydraulic_boundary_database_imported,
+ RingtoetsCommonFormsResources.CalculateAllIcon,
+ false);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_FailureMechanismSectionsSetHydraulicBoundaryDatabaseNotValid_ContextMenuItemCalculateAllDisabledAndTooltipSet()
@@ -520,16 +521,16 @@
// Call
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- ToolStripItem contextMenuItem = contextMenu.Items[contextMenuCalculateAllIndexRootGroup];
+ // Assert
+ ToolStripItem contextMenuItem = contextMenu.Items[contextMenuCalculateAllIndexRootGroup];
- Assert.AreEqual(RingtoetsCommonFormsResources.Calculate_all, contextMenuItem.Text);
- StringAssert.Contains(string.Format(Resources.Hydraulic_boundary_database_connection_failed_0_, ""), contextMenuItem.ToolTipText);
- TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.CalculateAllIcon, contextMenuItem.Image);
- Assert.IsFalse(contextMenuItem.Enabled);
+ Assert.AreEqual(RingtoetsCommonFormsResources.Calculate_all, contextMenuItem.Text);
+ StringAssert.Contains(string.Format(Resources.Hydraulic_boundary_database_connection_failed_0_, ""), contextMenuItem.ToolTipText);
+ TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.CalculateAllIcon, contextMenuItem.Image);
+ Assert.IsFalse(contextMenuItem.Enabled);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_FailureMechanismSectionsAndHydraulicDatabaseSet_ContextMenuItemCalculateAllEnabled()
@@ -576,14 +577,14 @@
// Call
using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
- RingtoetsCommonFormsResources.Calculate_all,
- RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_ToolTip,
- RingtoetsCommonFormsResources.CalculateAllIcon);
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndexRootGroup,
+ RingtoetsCommonFormsResources.Calculate_all,
+ RingtoetsCommonFormsResources.CalculationGroup_CalculateAll_ToolTip,
+ RingtoetsCommonFormsResources.CalculateAllIcon);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_FailureMechanismWithoutDikeProfiles_ContextMenuItemGenerateCalculationsDisabledAndTooltipSet()
@@ -609,15 +610,15 @@
// Call
using (var contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuGenerateCalculationsIndexRootGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Generate_Scenarios,
- GrassCoverErosionInwardsPluginResources.GrassCoverErosionInwardsPlugin_CreateGenerateCalculationsItem_NoDikeLocations_ToolTip,
- RingtoetsCommonFormsResources.GenerateScenariosIcon,
- false);
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuGenerateCalculationsIndexRootGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Generate_Scenarios,
+ GrassCoverErosionInwardsPluginResources.GrassCoverErosionInwardsPlugin_CreateGenerateCalculationsItem_NoDikeLocations_ToolTip,
+ RingtoetsCommonFormsResources.GenerateScenariosIcon,
+ false);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_FailureMechanismWithDikeProfiles_ContextMenuItemGenerateCalculationsDisabledAndTooltipSet()
@@ -644,14 +645,14 @@
// Call
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Assert
- TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuGenerateCalculationsIndexRootGroup,
- RingtoetsCommonFormsResources.CalculationGroup_Generate_Scenarios,
- GrassCoverErosionInwardsPluginResources.GrassCoverErosionInwardsPlugin_CreateGenerateCalculationsItem_ToolTip,
- RingtoetsCommonFormsResources.GenerateScenariosIcon);
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuGenerateCalculationsIndexRootGroup,
+ RingtoetsCommonFormsResources.CalculationGroup_Generate_Scenarios,
+ GrassCoverErosionInwardsPluginResources.GrassCoverErosionInwardsPlugin_CreateGenerateCalculationsItem_ToolTip,
+ RingtoetsCommonFormsResources.GenerateScenariosIcon);
+ }
}
}
- }
[Test]
public void ContextMenuStrip_ClickOnCalculateAllItem_ValidateAllChildCalculations()
@@ -709,21 +710,21 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(groupContext, null, treeViewControl))
{
- // Call
- TestHelper.AssertLogMessages(() => contextMenu.Items[contextMenuValidateAllIndexRootGroup].PerformClick(), messages =>
- {
- var messageList = messages.ToList();
+ // Call
+ TestHelper.AssertLogMessages(() => contextMenu.Items[contextMenuValidateAllIndexRootGroup].PerformClick(), messages =>
+ {
+ var messageList = messages.ToList();
- // Assert
- Assert.AreEqual(4, messageList.Count);
- StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]);
- StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]);
- StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[2]);
- StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[3]);
- });
+ // Assert
+ Assert.AreEqual(4, messageList.Count);
+ StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]);
+ StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]);
+ StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[2]);
+ StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[3]);
+ });
+ }
}
}
- }
[Test]
public void ContextMenuStrip_ClickOnCalculateAllItem_ScheduleAllChildCalculations()
@@ -789,31 +790,31 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(groupContext, null, treeViewControl))
{
- // Call
- TestHelper.AssertLogMessages(() => contextMenu.Items[contextMenuCalculateAllIndexRootGroup].PerformClick(), messages =>
- {
- var messageList = messages.ToList();
+ // Call
+ TestHelper.AssertLogMessages(() => contextMenu.Items[contextMenuCalculateAllIndexRootGroup].PerformClick(), messages =>
+ {
+ var messageList = messages.ToList();
- // Assert
- Assert.AreEqual(14, messageList.Count);
- StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]);
- StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]);
- StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]);
- StringAssert.StartsWith("Hydra-Ring berekeningsverslag. Klik op details voor meer informatie.", messageList[3]);
- Assert.AreEqual("De berekening voor grasbekleding erosie kruin en binnentalud 'A' is niet gelukt.", messageList[4]);
- StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[5]);
- StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[6]);
- StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[7]);
- StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[8]);
- StringAssert.StartsWith("Hydra-Ring berekeningsverslag. Klik op details voor meer informatie.", messageList[9]);
- Assert.AreEqual("De berekening voor grasbekleding erosie kruin en binnentalud 'B' is niet gelukt.", messageList[10]);
- StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[11]);
- Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[12]);
- Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[13]);
- });
+ // Assert
+ Assert.AreEqual(14, messageList.Count);
+ StringAssert.StartsWith("Validatie van 'A' gestart om: ", messageList[0]);
+ StringAssert.StartsWith("Validatie van 'A' beëindigd om: ", messageList[1]);
+ StringAssert.StartsWith("Berekening van 'A' gestart om: ", messageList[2]);
+ StringAssert.StartsWith("Hydra-Ring berekeningsverslag. Klik op details voor meer informatie.", messageList[3]);
+ Assert.AreEqual("De berekening voor grasbekleding erosie kruin en binnentalud 'A' is niet gelukt.", messageList[4]);
+ StringAssert.StartsWith("Berekening van 'A' beëindigd om: ", messageList[5]);
+ StringAssert.StartsWith("Validatie van 'B' gestart om: ", messageList[6]);
+ StringAssert.StartsWith("Validatie van 'B' beëindigd om: ", messageList[7]);
+ StringAssert.StartsWith("Berekening van 'B' gestart om: ", messageList[8]);
+ StringAssert.StartsWith("Hydra-Ring berekeningsverslag. Klik op details voor meer informatie.", messageList[9]);
+ Assert.AreEqual("De berekening voor grasbekleding erosie kruin en binnentalud 'B' is niet gelukt.", messageList[10]);
+ StringAssert.StartsWith("Berekening van 'B' beëindigd om: ", messageList[11]);
+ Assert.AreEqual("Uitvoeren van 'A' is mislukt.", messageList[12]);
+ Assert.AreEqual("Uitvoeren van 'B' is mislukt.", messageList[13]);
+ });
+ }
}
}
- }
[Test]
public void ContextMenuStrip_ClickOnAddGroupItem_AddGroupToCalculationGroupAndNotifyObservers()
@@ -845,21 +846,21 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Precondition
- Assert.AreEqual(1, group.Children.Count);
+ // Precondition
+ Assert.AreEqual(1, group.Children.Count);
- // Call
- contextMenu.Items[contextMenuAddCalculationGroupIndexRootGroup].PerformClick();
+ // Call
+ contextMenu.Items[contextMenuAddCalculationGroupIndexRootGroup].PerformClick();
- // Assert
- Assert.AreEqual(2, group.Children.Count);
- var newlyAddedItem = group.Children.Last();
- Assert.IsInstanceOf(newlyAddedItem);
- Assert.AreEqual("Nieuwe map (1)", newlyAddedItem.Name,
- "An item with the same name default name already exists, therefore '(1)' needs to be appended.");
+ // Assert
+ Assert.AreEqual(2, group.Children.Count);
+ var newlyAddedItem = group.Children.Last();
+ Assert.IsInstanceOf(newlyAddedItem);
+ Assert.AreEqual("Nieuwe map (1)", newlyAddedItem.Name,
+ "An item with the same name default name already exists, therefore '(1)' needs to be appended.");
+ }
}
}
- }
[Test]
public void ContextMenuStrip_ClickOnAddCalculationItem_AddCalculationToCalculationGroupAndNotifyObservers()
@@ -891,21 +892,21 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Precondition
- Assert.AreEqual(1, group.Children.Count);
+ // Precondition
+ Assert.AreEqual(1, group.Children.Count);
- // Call
- contextMenu.Items[contextMenuAddCalculationIndexRootGroup].PerformClick();
+ // Call
+ contextMenu.Items[contextMenuAddCalculationIndexRootGroup].PerformClick();
- // Assert
- Assert.AreEqual(2, group.Children.Count);
- var newlyAddedItem = group.Children.Last();
- Assert.IsInstanceOf(newlyAddedItem);
- Assert.AreEqual("Nieuwe berekening (1)", newlyAddedItem.Name,
- "An item with the same name default name already exists, therefore '(1)' needs to be appended.");
+ // Assert
+ Assert.AreEqual(2, group.Children.Count);
+ var newlyAddedItem = group.Children.Last();
+ Assert.IsInstanceOf(newlyAddedItem);
+ Assert.AreEqual("Nieuwe berekening (1)", newlyAddedItem.Name,
+ "An item with the same name default name already exists, therefore '(1)' needs to be appended.");
+ }
}
}
- }
[Test]
public void ContextMenuStrip_ClickOnRemoveAllInGroup_RemovesAllChildren()
@@ -947,14 +948,14 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // Call
- contextMenu.Items[contextMenuRemoveAllChildrenRootGroupIndex].PerformClick();
+ // Call
+ contextMenu.Items[contextMenuRemoveAllChildrenRootGroupIndex].PerformClick();
- // Assert
- Assert.IsEmpty(group.Children);
+ // Assert
+ Assert.IsEmpty(group.Children);
+ }
}
}
- }
[Test]
public void GivenCalculationsViewGenerateScenariosButtonClicked_WhenDikeProfileSelectedAndDialogClosed_ThenCalculationsAddedWithProfileAssigned()
@@ -993,25 +994,25 @@
DialogBoxHandler = (name, wnd) =>
{
- var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog) new FormTester(name).TheObject;
- var grid = (DataGridView) new ControlTester("DikeProfileDataGrid", selectionDialog).TheObject;
+ var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog)new FormTester(name).TheObject;
+ var grid = (DataGridViewControl)new ControlTester("DataGridViewControl", selectionDialog).TheObject;
grid.Rows[0].Cells[0].Value = true;
- new ButtonTester("OkButton", selectionDialog).Click();
+ new ButtonTester("DoForSelectedButton", selectionDialog).Click();
};
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // When
- contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
+ // When
+ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
- // Then
- var grassCoverErosionInwardsCalculations = failureMechanism.Calculations.OfType().ToArray();
- Assert.AreEqual(1, grassCoverErosionInwardsCalculations.Length);
+ // Then
+ var grassCoverErosionInwardsCalculations = failureMechanism.Calculations.OfType().ToArray();
+ Assert.AreEqual(1, grassCoverErosionInwardsCalculations.Length);
+ }
}
}
- }
[Test]
public void GivenCalculationsViewGenerateScenariosButtonClicked_WhenCancelButtonClickedAndDialogClosed_ThenCalculationsNotUpdated()
@@ -1050,8 +1051,8 @@
DialogBoxHandler = (name, wnd) =>
{
- var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog) new FormTester(name).TheObject;
- var grid = (DataGridView) new ControlTester("DikeProfileDataGrid", selectionDialog).TheObject;
+ var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog)new FormTester(name).TheObject;
+ var grid = (DataGridViewControl)new ControlTester("DataGridViewControl", selectionDialog).TheObject;
grid.Rows[0].Cells[0].Value = true;
@@ -1060,14 +1061,14 @@
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- // When
- contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
+ // When
+ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
- // Then
- Assert.AreEqual(0, failureMechanism.Calculations.OfType().Count());
+ // Then
+ Assert.AreEqual(0, failureMechanism.Calculations.OfType().Count());
+ }
}
}
- }
[Test]
public void GivenScenariosWithExistingCalculationWithSameName_WhenOkButtonClickedAndDialogClosed_ThenCalculationWithUniqueNameAdded()
@@ -1115,28 +1116,28 @@
DialogBoxHandler = (name, wnd) =>
{
- var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog) new FormTester(name).TheObject;
- var grid = (DataGridView) new ControlTester("DikeProfileDataGrid", selectionDialog).TheObject;
+ var selectionDialog = (GrassCoverErosionInwardsDikeProfileSelectionDialog)new FormTester(name).TheObject;
+ var grid = (DataGridViewControl)new ControlTester("DataGridViewControl", selectionDialog).TheObject;
grid.Rows[0].Cells[0].Value = true;
- new ButtonTester("OkButton", selectionDialog).Click();
+ new ButtonTester("DoForSelectedButton", selectionDialog).Click();
};
using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
{
- string expectedNewName = NamingHelper.GetUniqueName(failureMechanism.CalculationsGroup.Children, existingCalculationName, c => c.Name);
+ string expectedNewName = NamingHelper.GetUniqueName(failureMechanism.CalculationsGroup.Children, existingCalculationName, c => c.Name);
- // When
- contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
+ // When
+ contextMenu.Items[contextMenuGenerateCalculationsIndexRootGroup].PerformClick();
- // Then
- var grassCoverErosionInwardsCalculations = failureMechanism.Calculations.OfType().ToArray();
- Assert.AreEqual(2, grassCoverErosionInwardsCalculations.Length);
- Assert.AreEqual(expectedNewName, grassCoverErosionInwardsCalculations[1].Name);
+ // Then
+ var grassCoverErosionInwardsCalculations = failureMechanism.Calculations.OfType().ToArray();
+ Assert.AreEqual(2, grassCoverErosionInwardsCalculations.Length);
+ Assert.AreEqual(expectedNewName, grassCoverErosionInwardsCalculations[1].Name);
+ }
}
}
- }
[Test]
public void OnNodeRemoved_NestedCalculationGroup_RemoveGroupAndNotifyObservers()
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsDikeProfileSelectionViewTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj
===================================================================
diff -u -rf05844909ef96f5e6ea721563a33d32e042ef5ce -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision f05844909ef96f5e6ea721563a33d32e042ef5ce)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -125,12 +125,6 @@
PipingFailureMechanismView.cs
-
- UserControl
-
-
- PipingSurfaceLineSelectionView.cs
-
@@ -243,9 +237,6 @@
PipingFailureMechanismView.cs
-
- PipingSurfaceLineSelectionView.cs
-
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingSurfaceLineSelectionView.Designer.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingSurfaceLineSelectionView.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/Views/PipingSurfaceLineSelectionView.resx'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj
===================================================================
diff -u -rf05844909ef96f5e6ea721563a33d32e042ef5ce -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision f05844909ef96f5e6ea721563a33d32e042ef5ce)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -114,7 +114,6 @@
-
Fisheye: Tag f1d18cd382e0e192259deb5dd2a8577ad05b22c1 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingSurfaceLineSelectionViewTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs
===================================================================
diff -u -r0f0d4ea78f79ab702bc3c28c78e83daa02c320b1 -rf1d18cd382e0e192259deb5dd2a8577ad05b22c1
--- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs) (revision 0f0d4ea78f79ab702bc3c28c78e83daa02c320b1)
+++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs (.../StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog.cs) (revision f1d18cd382e0e192259deb5dd2a8577ad05b22c1)
@@ -45,6 +45,7 @@
///
/// The parent of the dialog.
/// The collection of to show in the dialog.
+ /// Thrown when any parameter is null.
public StabilityStoneCoverHydraulicBoundaryLocationSelectionDialog(IWin32Window dialogParent,
IEnumerable hydraulicBoundaryLocations)
: base(dialogParent)