Author: toshok Date: 2006-11-15 20:52:37 -0500 (Wed, 15 Nov 2006) New Revision: 67969
Added: trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ApplicationTest.cs Log: Application unit tests Added: trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ApplicationTest.cs =================================================================== --- trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ApplicationTest.cs 2006-11-16 01:11:49 UTC (rev 67968) +++ trunk/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ApplicationTest.cs 2006-11-16 01:52:37 UTC (rev 67969) @@ -0,0 +1,43 @@ +// +// ApplicationContextTest.cs +// +// Author: +// Chris Toshok ([EMAIL PROTECTED]) +// +// (C) 2006 Novell, Inc. (http://www.novell.com) +// + +using System; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Reflection; +using NUnit.Framework; + +namespace MonoTests.System.Windows.Forms +{ + [TestFixture] + public class ApplicationTest + { + ApplicationContext ctx; + + void form_visible_changed (object sender, EventArgs e) + { + Assert.AreEqual (sender, ctx.MainForm, "1"); + ((Form)sender).Close(); + } + + [Test] + public void ContextMainFormTest () + { + Form f1 = new Form (); + ctx = new ApplicationContext (f1); + + f1.VisibleChanged += new EventHandler (form_visible_changed); + + Application.Run (ctx); + + Assert.IsNull (ctx.MainForm, "2"); + } + } +} _______________________________________________ Mono-patches maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-patches
