Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj
===================================================================
diff -u -rf7a04cbe5e015450af38a8983a4c57c5022722f2 -r9fffdfe86ac1685eb9369e2190c26181e3613cb1
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj (.../Ringtoets.ClosingStructures.Forms.csproj) (revision f7a04cbe5e015450af38a8983a4c57c5022722f2)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Ringtoets.ClosingStructures.Forms.csproj (.../Ringtoets.ClosingStructures.Forms.csproj) (revision 9fffdfe86ac1685eb9369e2190c26181e3613cb1)
@@ -117,6 +117,9 @@
Resources.Designer.cs
Designer
+
+ ClosingStructuresScenariosView.cs
+
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.Designer.cs
===================================================================
diff -u -r2ec06c41e23172aee5fba6f3b6588486c922514b -r9fffdfe86ac1685eb9369e2190c26181e3613cb1
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.Designer.cs (.../ClosingStructuresScenariosView.Designer.cs) (revision 2ec06c41e23172aee5fba6f3b6588486c922514b)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.Designer.cs (.../ClosingStructuresScenariosView.Designer.cs) (revision 9fffdfe86ac1685eb9369e2190c26181e3613cb1)
@@ -49,10 +49,31 @@
///
private void InitializeComponent()
{
- components = new System.ComponentModel.Container();
+ this.scenarioSelectionControl = new Ringtoets.Common.Forms.ScenarioSelectionControl();
+ this.SuspendLayout();
+ //
+ // scenarioSelectionControl
+ //
+ this.scenarioSelectionControl.AutoScroll = true;
+ this.scenarioSelectionControl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.scenarioSelectionControl.Location = new System.Drawing.Point(0, 0);
+ this.scenarioSelectionControl.Name = "scenarioSelectionControl";
+ this.scenarioSelectionControl.Size = new System.Drawing.Size(150, 150);
+ this.scenarioSelectionControl.TabIndex = 0;
+ //
+ // ClosingStructuresScenariosView
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.scenarioSelectionControl);
+ this.Name = "ClosingStructuresScenariosView";
+ this.ResumeLayout(false);
+ this.AutoScroll = true;
+
}
#endregion
+
+ private Common.Forms.ScenarioSelectionControl scenarioSelectionControl;
}
}
Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.resx
===================================================================
diff -u
--- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.resx (revision 0)
+++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/Views/ClosingStructuresScenariosView.resx (revision 9fffdfe86ac1685eb9369e2190c26181e3613cb1)
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
\ No newline at end of file
Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresScenariosViewTest.cs
===================================================================
diff -u -r2190156241cd307f0d9d784f2ff50ed339c3beac -r9fffdfe86ac1685eb9369e2190c26181e3613cb1
--- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresScenariosViewTest.cs (.../ClosingStructuresScenariosViewTest.cs) (revision 2190156241cd307f0d9d784f2ff50ed339c3beac)
+++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/Views/ClosingStructuresScenariosViewTest.cs (.../ClosingStructuresScenariosViewTest.cs) (revision 9fffdfe86ac1685eb9369e2190c26181e3613cb1)
@@ -19,26 +19,94 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System.Drawing;
using System.Windows.Forms;
using Core.Common.Controls.Views;
+using NUnit.Extensions.Forms;
using NUnit.Framework;
+using Ringtoets.ClosingStructures.Data;
using Ringtoets.ClosingStructures.Forms.Views;
+using Ringtoets.Common.Data.Calculation;
+using Ringtoets.Common.Forms;
namespace Ringtoets.ClosingStructures.Forms.Test.Views
{
[TestFixture]
public class ClosingStructuresScenariosViewTest
{
+ private Form testForm;
+
+ [SetUp]
+ public void Setup()
+ {
+ testForm = new Form();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ testForm.Dispose();
+ }
+
[Test]
- public void Constructur_ExpectedValues()
+ public void DefaultConstructor_DataGridViewCorrectlyInitialized()
{
// Call
- var view = new ClosingStructuresScenariosView();
+ using (var view = ShowScenariosView())
+ {
+ // Assert
+ Assert.IsInstanceOf(view);
+ Assert.IsInstanceOf(view);
+ Assert.IsTrue(view.AutoScroll);
+ Assert.IsNull(view.Data);
+ Assert.IsNull(view.FailureMechanism);
- // Assert
- Assert.IsInstanceOf(view);
- Assert.IsInstanceOf(view);
- CollectionAssert.IsEmpty(view.Controls);
+ var scenarioSelectionControl = new ControlTester("scenarioSelectionControl").TheObject as ScenarioSelectionControl;
+
+ Assert.NotNull(scenarioSelectionControl);
+ Assert.AreEqual(new Size(0, 0), scenarioSelectionControl.MinimumSize);
+ }
}
+
+ [Test]
+ public void Data_ValidDataSet_ValidData()
+ {
+ // Setup
+ using (var view = ShowScenariosView())
+ {
+ var calculationGroup = new CalculationGroup();
+
+ // Call
+ view.Data = calculationGroup;
+
+ // Assert
+ Assert.AreSame(calculationGroup, view.Data);
+ }
+ }
+
+ [Test]
+ public void FailureMechanism_ValidFailureMechanismSet_ValidFailureMechanism()
+ {
+ // Setup
+ using (var view = ShowScenariosView())
+ {
+ var failureMechanism = new ClosingStructuresFailureMechanism();
+
+ // Call
+ view.FailureMechanism = failureMechanism;
+
+ // Assert
+ Assert.AreSame(failureMechanism, view.FailureMechanism);
+ }
+ }
+
+ private ClosingStructuresScenariosView ShowScenariosView()
+ {
+ var scenariosView = new ClosingStructuresScenariosView();
+ testForm.Controls.Add(scenariosView);
+ testForm.Show();
+
+ return scenariosView;
+ }
}
}
\ No newline at end of file