Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CommentViewTest.cs =================================================================== diff -u -r56fcaa1987b9a7235553ff43a0a4f36b46efdb2e -rda4ca78323eaccee879c224875a506aa3b9fdf54 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CommentViewTest.cs (.../CommentViewTest.cs) (revision 56fcaa1987b9a7235553ff43a0a4f36b46efdb2e) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/CommentViewTest.cs (.../CommentViewTest.cs) (revision da4ca78323eaccee879c224875a506aa3b9fdf54) @@ -19,7 +19,6 @@ // 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.TextEditor; using Core.Common.Controls.Views; @@ -143,10 +142,35 @@ // Assert Assert.AreEqual(validRtfString, data.Comments); } - mocks.VerifyAll(); } + [Test] + public void RichTextEditorOnTextChanged_WithoutData_DoesNotChangeComment() + { + // Setup + using (var form = new Form()) + using (var view = new CommentView()) + { + form.Controls.Add(view); + form.Show(); + + view.Data = null; + + var expectedText = ""; + var validRtfString = GetValidRtfString(expectedText); + + var richTextBoxControl = (RichTextBoxControl)new ControlTester("richTextBoxControl").TheObject; + + // Call + TestDelegate test = () => richTextBoxControl.Rtf = validRtfString; + + // Assert + Assert.DoesNotThrow(test); + } + } + + private static string GetValidRtfString(string value) { using (var richTextBox = new RichTextBox