ソースを参照

* RichTextBoxTest.cs: Improved PreferredHeight test.
* TextBoxTest.cs: Same.

svn path=/trunk/mcs/; revision=69852

Gert Driesen 19 年 前
コミット
b08cdc9985

+ 11 - 3
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/RichTextBoxTest.cs

@@ -178,11 +178,19 @@ namespace MonoTests.System.Windows.Forms
 		{
 			RichTextBox rtb = new RichTextBox ();
 			rtb.Font = new Font ("Arial", 14);
-			Assert.AreEqual (29, rtb.PreferredHeight, "#1");
+			Assert.AreEqual (29, rtb.PreferredHeight, "#A1");
 			rtb.Font = new Font ("Arial", 16);
-			Assert.AreEqual (32, rtb.PreferredHeight, "#2");
+			Assert.AreEqual (32, rtb.PreferredHeight, "#A2");
 			rtb.Font = new Font ("Arial", 17);
-			Assert.AreEqual (34, rtb.PreferredHeight, "#3");
+			Assert.AreEqual (34, rtb.PreferredHeight, "#A3");
+
+			rtb.BorderStyle = BorderStyle.None;
+
+			Assert.AreEqual (27, rtb.PreferredHeight, "#B1");
+			rtb.Font = new Font ("Arial", 14);
+			Assert.AreEqual (22, rtb.PreferredHeight, "#B2");
+			rtb.Font = new Font ("Arial", 16);
+			Assert.AreEqual (25, rtb.PreferredHeight, "#B3");
 		}
 	}
 }

+ 11 - 3
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TextBoxTest.cs

@@ -264,11 +264,19 @@ namespace MonoTests.System.Windows.Forms
 		public void PreferredHeight ()
 		{
 			textBox.Font = new Font ("Arial", 14);
-			Assert.AreEqual (29, textBox.PreferredHeight, "#1");
+			Assert.AreEqual (29, textBox.PreferredHeight, "#A1");
 			textBox.Font = new Font ("Arial", 16);
-			Assert.AreEqual (32, textBox.PreferredHeight, "#2");
+			Assert.AreEqual (32, textBox.PreferredHeight, "#A2");
 			textBox.Font = new Font ("Arial", 17);
-			Assert.AreEqual (34, textBox.PreferredHeight, "#3");
+			Assert.AreEqual (34, textBox.PreferredHeight, "#A3");
+
+			textBox.BorderStyle = BorderStyle.None;
+
+			Assert.AreEqual (27, textBox.PreferredHeight, "#B1");
+			textBox.Font = new Font ("Arial", 14);
+			Assert.AreEqual (22, textBox.PreferredHeight, "#B2");
+			textBox.Font = new Font ("Arial", 16);
+			Assert.AreEqual (25, textBox.PreferredHeight, "#B3");
 		}
 
 		[Test]