GroupBoxTest.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // GroupBoxTest.cs: Test cases for GroupBox.
  3. //
  4. // Author:
  5. // Ritvik Mayank ([email protected])
  6. //
  7. // (C) 2005 Novell, Inc. (http://www.novell.com)
  8. //
  9. using System;
  10. using System.Windows.Forms;
  11. using System.Drawing;
  12. using System.Reflection;
  13. using NUnit.Framework;
  14. namespace MonoTests.System.Windows.Forms
  15. {
  16. [TestFixture]
  17. public class GroupBoxTest
  18. {
  19. [Test]
  20. public void GroupBoxPropertyTest ()
  21. {
  22. Form myform = new Form ();
  23. GroupBox mygrpbox = new GroupBox ();
  24. RadioButton myradiobutton1 = new RadioButton ();
  25. RadioButton myradiobutton2 = new RadioButton ();
  26. mygrpbox.Controls.Add (myradiobutton1);
  27. mygrpbox.Controls.Add (myradiobutton2);
  28. myform.Show ();
  29. Assert.AreEqual (FlatStyle.Standard, mygrpbox.FlatStyle, "#1");
  30. mygrpbox.FlatStyle = FlatStyle.Popup;
  31. Assert.AreEqual (FlatStyle.Popup, mygrpbox.FlatStyle, "#2");
  32. mygrpbox.FlatStyle = FlatStyle.Flat;
  33. Assert.AreEqual (FlatStyle.Flat, mygrpbox.FlatStyle, "#3");
  34. mygrpbox.FlatStyle = FlatStyle.System;
  35. Assert.AreEqual (FlatStyle.System, mygrpbox.FlatStyle, "#4");
  36. myform.Dispose ();
  37. }
  38. }
  39. }