2 // Copyright (c) 2005 Novell, Inc.
5 // Ritvik Mayank (mritvik@novell.com)
9 using System.Windows.Forms;
11 using NUnit.Framework;
13 namespace MonoTests.System.Windows.Forms
16 public class CheckBoxEventTest
18 static bool eventhandled = false;
19 public void CheckBox_EventHandler (object sender,EventArgs e)
25 public void ApperanceEventTest ()
27 Form myform = new Form ();
28 myform.Visible = true;
29 CheckBox chkbox = new CheckBox ();
30 chkbox.Visible = true;
31 myform.Controls.Add (chkbox);
32 chkbox.AppearanceChanged += new EventHandler (CheckBox_EventHandler);
33 chkbox.Appearance = Appearance.Button;
34 Assert.AreEqual (true, eventhandled, "#A1");
38 public void CheckedChangedEventTest ()
41 Form myform = new Form ();
42 myform.Visible = true;
43 CheckBox chkbox = new CheckBox ();
44 chkbox.Visible = true;
45 myform.Controls.Add (chkbox);
46 chkbox.CheckedChanged += new EventHandler (CheckBox_EventHandler);
47 chkbox.CheckState = CheckState.Indeterminate;
48 Assert.AreEqual (true, eventhandled, "#A2");
52 public void CheckStateChangedEventTest ()
55 Form myform = new Form ();
56 myform.Visible = true;
57 CheckBox chkbox = new CheckBox ();
58 chkbox.Visible = true;
59 myform.Controls.Add (chkbox);
60 chkbox.CheckStateChanged += new EventHandler (CheckBox_EventHandler);
61 chkbox.CheckState = CheckState.Checked;
62 Assert.AreEqual (true, eventhandled, "#A3");