Index: Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs
===================================================================
diff -u -re42bdf3dd379c46bab9212eb7b30f4754c9bc91c -r1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c
--- Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs (.../SelectItemDialogTest.cs) (revision e42bdf3dd379c46bab9212eb7b30f4754c9bc91c)
+++ Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs (.../SelectItemDialogTest.cs) (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -81,6 +81,8 @@
Assert.AreEqual(320, dialog.MinimumSize.Width);
Assert.AreEqual(220, dialog.MinimumSize.Height);
}
+
+ mocks.VerifyAll();
}
[Test]
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj
===================================================================
diff -u -r41837216a2f3d66c3084500f4dcef57c478bfef5 -r1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 41837216a2f3d66c3084500f4dcef57c478bfef5)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -38,6 +38,7 @@
+
@@ -153,6 +154,12 @@
WaveHeightLocationsView.cs
+
+ Form
+
+
+ WmtsConnectionDialog.cs
+
UserControl
@@ -277,6 +284,9 @@
WaveHeightLocationsView.cs
Designer
+
+ WmtsConnectionDialog.cs
+
WmtsLocationControl.cs
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.Designer.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.Designer.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.Designer.cs (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -0,0 +1,137 @@
+// Copyright (C) Stichting Deltares 2016. 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.
+
+namespace Ringtoets.Integration.Forms.Views
+{
+ partial class WmtsConnectionDialog
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WmtsConnectionDialog));
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+ this.nameTextBox = new System.Windows.Forms.TextBox();
+ this.urlTextBox = new System.Windows.Forms.TextBox();
+ this.nameLabel = new System.Windows.Forms.Label();
+ this.urlLabel = new System.Windows.Forms.Label();
+ this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+ this.cancelButton = new System.Windows.Forms.Button();
+ this.actionButton = new System.Windows.Forms.Button();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.tableLayoutPanel3.SuspendLayout();
+ this.flowLayoutPanel1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tableLayoutPanel1
+ //
+ resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel3, 0, 0);
+ this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 2);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ //
+ // tableLayoutPanel3
+ //
+ resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3");
+ this.tableLayoutPanel3.Controls.Add(this.nameTextBox, 1, 0);
+ this.tableLayoutPanel3.Controls.Add(this.urlTextBox, 1, 1);
+ this.tableLayoutPanel3.Controls.Add(this.nameLabel, 0, 0);
+ this.tableLayoutPanel3.Controls.Add(this.urlLabel, 0, 1);
+ this.tableLayoutPanel3.Name = "tableLayoutPanel3";
+ //
+ // nameTextBox
+ //
+ resources.ApplyResources(this.nameTextBox, "nameTextBox");
+ this.nameTextBox.Name = "nameTextBox";
+ //
+ // urlTextBox
+ //
+ resources.ApplyResources(this.urlTextBox, "urlTextBox");
+ this.urlTextBox.Name = "urlTextBox";
+ //
+ // nameLabel
+ //
+ resources.ApplyResources(this.nameLabel, "nameLabel");
+ this.nameLabel.Name = "nameLabel";
+ //
+ // urlLabel
+ //
+ resources.ApplyResources(this.urlLabel, "urlLabel");
+ this.urlLabel.Name = "urlLabel";
+ //
+ // flowLayoutPanel1
+ //
+ resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1");
+ this.tableLayoutPanel1.SetColumnSpan(this.flowLayoutPanel1, 2);
+ this.flowLayoutPanel1.Controls.Add(this.cancelButton);
+ this.flowLayoutPanel1.Controls.Add(this.actionButton);
+ this.flowLayoutPanel1.Name = "flowLayoutPanel1";
+ //
+ // cancelButton
+ //
+ resources.ApplyResources(this.cancelButton, "cancelButton");
+ this.cancelButton.Name = "cancelButton";
+ this.cancelButton.UseVisualStyleBackColor = true;
+ //
+ // actionButton
+ //
+ resources.ApplyResources(this.actionButton, "actionButton");
+ this.actionButton.Name = "actionButton";
+ this.actionButton.UseVisualStyleBackColor = true;
+ //
+ // WmtsConnectionDialog
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.Name = "WmtsConnectionDialog";
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel1.PerformLayout();
+ this.tableLayoutPanel3.ResumeLayout(false);
+ this.tableLayoutPanel3.PerformLayout();
+ this.flowLayoutPanel1.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.TextBox urlTextBox;
+ private System.Windows.Forms.TextBox nameTextBox;
+ private System.Windows.Forms.Button actionButton;
+ private System.Windows.Forms.Button cancelButton;
+ private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
+ private System.Windows.Forms.Label nameLabel;
+ private System.Windows.Forms.Label urlLabel;
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.cs (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -0,0 +1,74 @@
+// Copyright (C) Stichting Deltares 2016. 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.Windows.Forms;
+using Core.Common.Controls.Dialogs;
+using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources;
+
+namespace Ringtoets.Integration.Forms.Views
+{
+ ///
+ /// A dialog which allows the user to set data, which is used for .
+ ///
+ public partial class WmtsConnectionDialog : DialogBase
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The parent of the dialog.
+ public WmtsConnectionDialog(IWin32Window dialogParent)
+ : base(dialogParent, CoreCommonGuiResources.RenameIcon, 250, 150)
+ {
+ InitializeComponent();
+ }
+
+ public string WmtsConnectionName
+ {
+ get
+ {
+ return nameTextBox.Text;
+ }
+ }
+
+ public string WmtsConnectionUrl
+ {
+ get
+ {
+ return urlTextBox.Text;
+ }
+ }
+
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ components?.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ protected override Button GetCancelButton()
+ {
+ return cancelButton;
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.resx
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.resx (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WmtsConnectionDialog.resx (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -0,0 +1,405 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ True
+
+
+ 1
+
+
+ True
+
+
+ 2
+
+
+
+ Fill
+
+
+
+ 79, 3
+
+
+ 6, 3, 6, 3
+
+
+ 308, 20
+
+
+ 3
+
+
+ nameTextBox
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel3
+
+
+ 0
+
+
+ Fill
+
+
+ 79, 29
+
+
+ 6, 3, 6, 3
+
+
+ 308, 20
+
+
+ 2
+
+
+ urlTextBox
+
+
+ System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel3
+
+
+ 1
+
+
+ True
+
+
+ 3, 6
+
+
+ 3, 6, 3, 0
+
+
+ 67, 13
+
+
+ 4
+
+
+ Omschrijving
+
+
+ nameLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel3
+
+
+ 2
+
+
+ True
+
+
+ 3, 32
+
+
+ 3, 6, 3, 0
+
+
+ 29, 13
+
+
+ 5
+
+
+ URL
+
+
+ urlLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel3
+
+
+ 3
+
+
+ Fill
+
+
+ 3, 3
+
+
+ 1
+
+
+ 393, 52
+
+
+ 0
+
+
+ tableLayoutPanel3
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 0
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="nameTextBox" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="urlTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="nameLabel" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="urlLabel" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings>
+
+
+ True
+
+
+ 315, 3
+
+
+ 75, 23
+
+
+ 5
+
+
+ Annuleren
+
+
+ cancelButton
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ flowLayoutPanel1
+
+
+ 0
+
+
+ 234, 3
+
+
+ 75, 23
+
+
+ 4
+
+
+ Toevoegen
+
+
+ actionButton
+
+
+ System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ flowLayoutPanel1
+
+
+ 1
+
+
+ Bottom
+
+
+ 3, 112
+
+
+ Yes
+
+
+ 393, 29
+
+
+ 2
+
+
+ flowLayoutPanel1
+
+
+ System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ tableLayoutPanel1
+
+
+ 1
+
+
+ Fill
+
+
+ 0, 0
+
+
+ 1
+
+
+ 399, 144
+
+
+ 1
+
+
+ tableLayoutPanel1
+
+
+ System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="tableLayoutPanel3" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="flowLayoutPanel1" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0" /><Rows Styles="AutoSize,0,Absolute,0,AutoSize,0" /></TableLayoutSettings>
+
+
+ True
+
+
+ 6, 13
+
+
+ 399, 144
+
+
+ WmtsConnectionDialog
+
+
+ WmtsConnectionDialog
+
+
+ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs
===================================================================
diff -u -rad5fba0bbb2b3a4a7d99bc29b218eec1f96c2def -r1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (.../BackgroundMapDataSelectionDialogTest.cs) (revision ad5fba0bbb2b3a4a7d99bc29b218eec1f96c2def)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (.../BackgroundMapDataSelectionDialogTest.cs) (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -21,6 +21,7 @@
using System;
using System.Drawing;
+using System.Threading;
using System.Windows.Forms;
using Core.Common.Controls.Dialogs;
using Core.Common.TestUtil;
@@ -67,25 +68,13 @@
}
[Test]
+ [Apartment(ApartmentState.STA)]
public void ShowDialog_Always_DefaultProperties()
{
// Setup
- Label mapLayerLabel = null;
- ComboBox mapLayers = null;
- GroupBox groupBoxProperties = null;
- Button buttonSelect = null;
- Button buttonCancel = null;
DialogBoxHandler = (name, wnd) =>
{
- using (var openedDialog = new FormTester(name))
- {
- var form = (Form) openedDialog.TheObject;
- mapLayerLabel = (Label) new LabelTester("mapLayerLabel", form).TheObject;
- mapLayers = (ComboBox) new ComboBoxTester("mapLayerComboBox", form).TheObject;
- groupBoxProperties = (GroupBox) new ControlTester("propertiesGroupBox", form).TheObject;
- buttonSelect = (Button) new ButtonTester("selectButton", form).TheObject;
- buttonCancel = (Button) new ButtonTester("cancelButton", form).TheObject;
- }
+ using (new FormTester(name)) {}
};
using (var dialogParent = new Form())
@@ -95,20 +84,20 @@
dialog.ShowDialog();
// Assert
- Assert.IsNotNull(mapLayerLabel);
+ var mapLayerLabel = new LabelTester("mapLayerLabel", dialog);
Assert.AreEqual("Type kaartlaag", mapLayerLabel.Text);
- Assert.IsNotNull(mapLayers);
+ var mapLayers = (ComboBox) new ComboBoxTester("mapLayerComboBox", dialog).TheObject;
Assert.IsFalse(mapLayers.Enabled);
- Assert.IsNotNull(groupBoxProperties);
+ var groupBoxProperties = new ControlTester("propertiesGroupBox", dialog);
Assert.AreEqual("Eigenschappen", groupBoxProperties.Text);
- Assert.IsNotNull(buttonSelect);
+ Button buttonSelect = (Button) new ButtonTester("selectButton", dialog).TheObject;
Assert.AreEqual("Selecteren", buttonSelect.Text);
Assert.IsFalse(buttonSelect.Enabled);
- Assert.IsNotNull(buttonCancel);
+ Button buttonCancel = (Button) new ButtonTester("cancelButton", dialog).TheObject;
Assert.AreEqual("Annuleren", buttonCancel.Text);
Assert.AreEqual(500, dialog.MinimumSize.Width);
@@ -117,6 +106,7 @@
}
[Test]
+ [Apartment(ApartmentState.STA)]
public void GivenValidDialog_WhenCancelPressed_ThenSelectedMapDataNull()
{
// Given
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj
===================================================================
diff -u -r41837216a2f3d66c3084500f4dcef57c478bfef5 -r1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 41837216a2f3d66c3084500f4dcef57c478bfef5)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -118,6 +118,7 @@
+
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsConnectionDialogTest.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsConnectionDialogTest.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsConnectionDialogTest.cs (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -0,0 +1,129 @@
+// Copyright (C) Stichting Deltares 2016. 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.Threading;
+using System.Windows.Forms;
+using Core.Common.Controls.Dialogs;
+using NUnit.Extensions.Forms;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Ringtoets.Integration.Forms.Views;
+
+namespace Ringtoets.Integration.Forms.Test.Views
+{
+ [TestFixture]
+ public class WmtsConnectionDialogTest :NUnitFormTest
+ {
+ [Test]
+ public void Constructor_WithoutDialogParent_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate test = () => new WmtsConnectionDialog(null);
+
+ // Assert
+ string paramName = Assert.Throws(test).ParamName;
+ Assert.AreEqual("dialogParent", paramName);
+ }
+
+ [Test]
+ public void WmtsConnectionAddDialog_WithDialogParent_ExpectedProperties()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var dialogParent = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ // Call
+ using (var dialog = new WmtsConnectionDialog(dialogParent))
+ {
+ // Assert
+ Assert.IsInstanceOf(dialog);
+ Assert.IsEmpty(dialog.WmtsConnectionName);
+ Assert.IsEmpty(dialog.WmtsConnectionUrl);
+
+ var nameLabel = new LabelTester("nameLabel", dialog);
+ Assert.AreEqual("Omschrijving", nameLabel.Text);
+
+ var urlLabel = new LabelTester("urlLabel", dialog);
+ Assert.AreEqual("URL", urlLabel.Text);
+
+ var actionButton = new ButtonTester("actionButton", dialog);
+ Assert.AreEqual("Toevoegen", actionButton.Text);
+
+ var cancelButton = new ButtonTester("cancelButton", dialog);
+ Assert.AreEqual("Annuleren", cancelButton.Text);
+
+ var nameTextBox = new TextBoxTester("nameTextBox", dialog);
+ Assert.IsEmpty(nameTextBox.Text);
+
+ var urlTextBox = new TextBoxTester("urlTextBox", dialog);
+ Assert.IsEmpty(urlTextBox.Text);
+ }
+
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ [Apartment(ApartmentState.STA)]
+ public void ShowDialog_DefaultProperties()
+ {
+ // Setup
+ DialogBoxHandler = (name, wnd) =>
+ {
+ using (new FormTester(name)){}
+ };
+
+ using (var dialogParent = new Form())
+ using (var dialog = new WmtsConnectionDialog(dialogParent))
+ {
+ // Call
+ dialog.ShowDialog();
+
+ // Assert
+ Assert.AreEqual(250, dialog.MinimumSize.Width);
+ Assert.AreEqual(150, dialog.MinimumSize.Height);
+ }
+ }
+
+ [Test]
+ public void Dispose_AlreadyDisposed_DoesNotThrowException()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var dialogParent = mocks.StrictMock();
+ mocks.ReplayAll();
+
+ // Call
+ TestDelegate call = () =>
+ {
+ using (var control = new WmtsConnectionDialog(dialogParent))
+ {
+ control.Dispose();
+ }
+ };
+
+ // Assert
+ Assert.DoesNotThrow(call);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsLocationControlTest.cs
===================================================================
diff -u -rad5fba0bbb2b3a4a7d99bc29b218eec1f96c2def -r1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsLocationControlTest.cs (.../WmtsLocationControlTest.cs) (revision ad5fba0bbb2b3a4a7d99bc29b218eec1f96c2def)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WmtsLocationControlTest.cs (.../WmtsLocationControlTest.cs) (revision 1fb54b1f8b8be7500a290f3cc8c3aaf46aa0b24c)
@@ -52,12 +52,13 @@
}
[Test]
- public void Show_DefaultProperties()
+ public void Show_AddedToForm_DefaultProperties()
{
- // Call
+ // Setup
using (var control = new WmtsLocationControl())
using (var form = new Form())
{
+ // Call
form.Controls.Add(control);
// Assert