Просмотр исходного кода

2006-04-12 Peter Dennis Bartok <[email protected]>

	* ControlTest.cs: Added backcolor tests related to transparency
	  (bug #78026)


svn path=/trunk/mcs/; revision=59395
Peter Dennis Bartok 20 лет назад
Родитель
Сommit
64bb9a4d14

+ 5 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog

@@ -1,3 +1,8 @@
+2006-04-12  Peter Dennis Bartok <[email protected]>
+
+	* ControlTest.cs: Added backcolor tests related to transparency
+	  (bug #78026)
+
 2006-03-31  Peter Dennis Bartok <[email protected]>
 
 	* ControlTest.cs: Ignore Invoke test, it hangs

+ 27 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ControlTest.cs

@@ -787,5 +787,32 @@ namespace MWF.MonoTest
 
 			Assert.AreEqual(5, c.LayoutCount, "Layout Suspend/Resume locking does not bottom out at 0");
 		}
+
+		[Test]
+		[ExpectedException(typeof(System.ArgumentException))]
+		public void TransparentBackgroundTest1() {
+			Control	c;
+
+			c = new Control();
+			c.BackColor = Color.Transparent;
+		}
+
+		[Test]
+		public void TransparentBackgroundTest2() {
+			Panel	c;
+
+			c = new Panel();
+			c.BackColor = Color.Transparent;
+			Assert.AreEqual(Color.Transparent, c.BackColor, "Transparent background not set");
+		}
+
+		[Test]
+		public void TransparentBackgroundTest3() {
+			Control	c;
+
+			c = new Control();
+			c.BackColor = Color.Empty;
+			Assert.AreEqual(Control.DefaultBackColor, c.BackColor, "Setting empty color failed");
+		}
 	}
 }