Merge pull request #2548 from esdrubal/discovery
[mono.git] / mcs / class / System.Windows.Forms / Test / System.Windows.Forms / FormThreadTest.cs
1 using System;
2 using System.Windows.Forms;
3 using System.Threading;
4 using Sys_Threading=System.Threading;
5
6 using NUnit.Framework;
7
8 using CategoryAttribute = NUnit.Framework.CategoryAttribute;
9
10 namespace MonoTests.System.Windows.Forms
11 {
12         [TestFixture]
13         public class FormThreadTest : TestHelper
14         {
15                 private static void GuiThread()
16                 {
17                         Form form1;
18
19                         form1 = new Form();
20                         form1.Show();
21                         form1.Dispose();
22                 }
23
24                 [Test]
25                 public void TestThreadFormsInit ()
26                 {
27                         Sys_Threading.Thread thread;
28
29                         thread = new Sys_Threading.Thread(new ThreadStart(GuiThread));
30                         thread.Start();
31                         thread.Join();
32
33                         try
34                         {
35                                 GuiThread();
36                         }
37                         catch (Exception e)
38                         {
39                                 Assert.Fail ("#1");
40                         }
41                 }
42         }
43 }