Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs =================================================================== diff -u -r152ba6203dc5ff26a7848b40bac675b3fe5d7f29 -rd338c022bac7833bc0eb3b8bd7b37f74d82df1f8 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs (.../IllustrationPointsTableControlTest.cs) (revision 152ba6203dc5ff26a7848b40bac675b3fe5d7f29) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsTableControlTest.cs (.../IllustrationPointsTableControlTest.cs) (revision d338c022bac7833bc0eb3b8bd7b37f74d82df1f8) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Linq; using System.Windows.Forms; using Core.Common.Controls.DataGrid; using NUnit.Framework; @@ -29,6 +30,25 @@ [TestFixture] public class IllustrationPointsTableControlTest { + private const int windDirectionColumnIndex = 0; + private const int closingScenarioColumnIndex = 1; + private const int calculatedProbabilityColumnIndex = 2; + private const int calculatedReliabilityColumnIndex = 3; + + private Form testForm; + + [SetUp] + public void Setup() + { + testForm = new Form(); + } + + [TearDown] + public void TearDown() + { + testForm.Dispose(); + } + [Test] public void Constructor_ExpectedValues() { @@ -41,5 +61,30 @@ Assert.AreEqual(1, control.Controls.Count); Assert.IsInstanceOf(control.Controls[0]); } + + [Test] + public void OnLoad_DataGridViewCorrectlyInitialized() + { + // Setup & Call + IllustrationPointsTableControl control = ShowControl(); + + // Assert + var dataGridView = (DataGridView) control.Controls.Find("DataGridView", true).Single(); + Assert.AreEqual(4, dataGridView.ColumnCount); + Assert.AreEqual("Windrichting", dataGridView.Columns[windDirectionColumnIndex].HeaderText); + Assert.AreEqual("Sluitscenario", dataGridView.Columns[closingScenarioColumnIndex].HeaderText); + Assert.AreEqual("Berekende kans", dataGridView.Columns[calculatedProbabilityColumnIndex].HeaderText); + Assert.AreEqual("Berekende beta", dataGridView.Columns[calculatedReliabilityColumnIndex].HeaderText); + } + + private IllustrationPointsTableControl ShowControl() + { + var control = new IllustrationPointsTableControl(); + + testForm.Controls.Add(control); + testForm.Show(); + + return control; + } } } \ No newline at end of file