Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs =================================================================== diff -u -rc4d2af65ad23757fb3bd11f93458839bc1787ded -r79545aa87d2fffbac4fc5b2aadb24db37270db8e --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision c4d2af65ad23757fb3bd11f93458839bc1787ded) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Views/PipingCalculationsViewTest.cs (.../PipingCalculationsViewTest.cs) (revision 79545aa87d2fffbac4fc5b2aadb24db37270db8e) @@ -48,14 +48,18 @@ private Form testForm; [SetUp] - public void Setup() + public override void Setup() { + base.Setup(); + testForm = new Form(); } [TearDown] - public void TearDown() + public override void TearDown() { + base.TearDown(); + testForm.Dispose(); } @@ -423,6 +427,60 @@ } [Test] + [TestCase("test", dampingFactorExitMeanColumnIndex)] + [TestCase("test", phreaticLevelExitMeanColumnIndex)] + [TestCase("test", entryPointLColumnIndex)] + [TestCase("test", exitPointLColumnIndex)] + [TestCase(";/[].,~!@#$%^&*()_-+={}|?", dampingFactorExitMeanColumnIndex)] + [TestCase(";/[].,~!@#$%^&*()_-+={}|?", phreaticLevelExitMeanColumnIndex)] + [TestCase(";/[].,~!@#$%^&*()_-+={}|?", entryPointLColumnIndex)] + [TestCase(";/[].,~!@#$%^&*()_-+={}|?", exitPointLColumnIndex)] + public void PipingCalculationsView_EditValueInvalid_ShowsErrorTooltip(string newValue, int cellIndex) + { + // Setup + ShowFullyConfiguredPipingCalculationsView(); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + // Call + dataGridView.Rows[0].Cells[cellIndex].Value = newValue; + + // Assert + Assert.AreEqual("De tekst moet een getal zijn.", dataGridView.Rows[0].ErrorText); + } + + [Test] + [TestCase("1", dampingFactorExitMeanColumnIndex)] + [TestCase("1e-6", dampingFactorExitMeanColumnIndex)] + [TestCase("1e+6", dampingFactorExitMeanColumnIndex)] + [TestCase("14.3", dampingFactorExitMeanColumnIndex)] + [TestCase("1", phreaticLevelExitMeanColumnIndex)] + [TestCase("1e-6", phreaticLevelExitMeanColumnIndex)] + [TestCase("1e+6", phreaticLevelExitMeanColumnIndex)] + [TestCase("14.3", phreaticLevelExitMeanColumnIndex)] + [TestCase("1", entryPointLColumnIndex)] + [TestCase("1e-6", entryPointLColumnIndex)] + [TestCase("1e+6", entryPointLColumnIndex)] + [TestCase("14.3", entryPointLColumnIndex)] + [TestCase("1", exitPointLColumnIndex)] + [TestCase("1e-6", exitPointLColumnIndex)] + [TestCase("1e+6", exitPointLColumnIndex)] + [TestCase("14.3", exitPointLColumnIndex)] + public void FailureMechanismResultView_EditValueValid_DoNotShowErrorToolTipAndEditValue(string newValue, int cellIndex) + { + // Setup + ShowFullyConfiguredPipingCalculationsView(); + + var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; + + // Call + dataGridView.Rows[0].Cells[cellIndex].Value = newValue; + + // Assert + Assert.IsEmpty(dataGridView.Rows[0].ErrorText); + } + + [Test] public void ButtonGenerateScenarios_WithoutSurfaceLines_ButtonDisabled() { // Setup