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
.ShowInTaskbar
= false;
29 myform
.Visible
= true;
30 CheckBox chkbox
= new CheckBox ();
31 chkbox
.Visible
= true;
32 myform
.Controls
.Add (chkbox
);
33 chkbox
.AppearanceChanged
+= new EventHandler (CheckBox_EventHandler
);
34 chkbox
.Appearance
= Appearance
.Button
;
35 Assert
.AreEqual (true, eventhandled
, "#A1");
40 public void CheckedChangedEventTest ()
42 Form myform
= new Form ();
43 myform
.ShowInTaskbar
= false;
45 myform
.Visible
= true;
46 CheckBox chkbox
= new CheckBox ();
47 chkbox
.Visible
= true;
48 myform
.Controls
.Add (chkbox
);
49 chkbox
.CheckedChanged
+= new EventHandler (CheckBox_EventHandler
);
50 chkbox
.CheckState
= CheckState
.Indeterminate
;
51 Assert
.AreEqual (true, eventhandled
, "#A2");
56 public void CheckStateChangedEventTest ()
58 Form myform
= new Form ();
59 myform
.ShowInTaskbar
= false;
61 myform
.Visible
= true;
62 CheckBox chkbox
= new CheckBox ();
63 chkbox
.Visible
= true;
64 myform
.Controls
.Add (chkbox
);
65 chkbox
.CheckStateChanged
+= new EventHandler (CheckBox_EventHandler
);
66 chkbox
.CheckState
= CheckState
.Checked
;
67 Assert
.AreEqual (true, eventhandled
, "#A3");