Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Merge/AssessmentSectionProviderDialogTest.cs =================================================================== diff -u -rd1e995328e2e80a3b292492724112a5072d31ca3 -r0234a4ac9558be408d64e4645fa5f0084b33178b --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Merge/AssessmentSectionProviderDialogTest.cs (.../AssessmentSectionProviderDialogTest.cs) (revision d1e995328e2e80a3b292492724112a5072d31ca3) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Merge/AssessmentSectionProviderDialogTest.cs (.../AssessmentSectionProviderDialogTest.cs) (revision 0234a4ac9558be408d64e4645fa5f0084b33178b) @@ -1,6 +1,7 @@ using System; using System.Drawing; using System.Linq; +using System.Threading; using System.Windows.Forms; using Core.Common.Controls.DataGrid; using Core.Common.Controls.Dialogs; @@ -129,6 +130,7 @@ var buttonCancel = (Button) new ButtonTester("cancelButton", dialog).TheObject; Assert.AreEqual("Annuleren", buttonCancel.Text); + Assert.AreEqual(dialog.CancelButton, buttonCancel); Assert.AreEqual(500, dialog.MinimumSize.Width); Assert.AreEqual(350, dialog.MinimumSize.Height); @@ -208,6 +210,29 @@ } [Test] + public void GivenValidDialog_WhenSelectDataCalledAndCancelPressed_ThenSelectedDataNullAndReturnsFalse() + { + // Given + using (var dialogParent = new Form()) + using (var dialog = new AssessmentSectionProviderDialog(dialogParent)) + { + // When + bool result = dialog.SelectData(new[] + { + TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations() + }); + + var button = new ButtonTester("cancelButton", dialog); + button.Click(); + + // Then + Assert.IsFalse(result); + Assert.IsNull(dialog.SelectedAssessmentSection); + Assert.IsNull(dialog.SelectedFailureMechanisms); + } + } + + [Test] public void GivenDialogWithAssessmentSection_WhenSelectingOtherAssessmentSection_ThenDataUpdated() { // Given