GroupBoxTest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. myform.ShowInTaskbar = false;
  24. GroupBox mygrpbox = new GroupBox ();
  25. RadioButton myradiobutton1 = new RadioButton ();
  26. RadioButton myradiobutton2 = new RadioButton ();
  27. mygrpbox.Controls.Add (myradiobutton1);
  28. mygrpbox.Controls.Add (myradiobutton2);
  29. myform.Show ();
  30. Assert.AreEqual (FlatStyle.Standard, mygrpbox.FlatStyle, "#1");
  31. mygrpbox.FlatStyle = FlatStyle.Popup;
  32. Assert.AreEqual (FlatStyle.Popup, mygrpbox.FlatStyle, "#2");
  33. mygrpbox.FlatStyle = FlatStyle.Flat;
  34. Assert.AreEqual (FlatStyle.Flat, mygrpbox.FlatStyle, "#3");
  35. mygrpbox.FlatStyle = FlatStyle.System;
  36. Assert.AreEqual (FlatStyle.System, mygrpbox.FlatStyle, "#4");
  37. myform.Dispose ();
  38. }
  39. }
  40. }