Exemple #1
0
            public OnClosedForm(ButtonedForm buttonedForm)
            {
                this.buttonedForm     = buttonedForm;
                this.CatchedException = null;

                this.Text = "OnClosedForm";
            }
Exemple #2
0
        public void OnClosedOverride_Test1()
        {
            const bool removeButtonOnClick = false;

            using (var f = new ButtonedForm(removeButtonOnClick)) {
                f.Show();
                Assert.Null(f.onClosedForm.CatchedException, "An exception has been detected in `WndProc`");
            }
        }
Exemple #3
0
        public void OnClosedOverride_Test2()
        {
            const bool removeButtonOnClick = true;

            var task = Task.Run(() => {
                using (var f = new ButtonedForm(removeButtonOnClick)) {
                    f.Show();
                }
            });

            var ok = task.Wait(TimeSpan.FromSeconds(1));

            Assert.True(ok, "Infinite loop has been detected in `WndProc`");
        }