Sfoglia il codice sorgente

* UnitTest.cs: Added test for unit value with no integral part. Code
formatting fixes.

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

Gert Driesen 19 anni fa
parent
commit
a76e18f458

+ 5 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,8 @@
+2007-04-07  Gert Driesen  <[email protected]>
+
+	* UnitTest.cs: Added test for unit value with no integral part. Code
+	formatting fixes.
+
 2007-03-20  Marek Habersack  <[email protected]>
 
 	* LoginStatusTest.cs: add a test for CssClass set on the rendered

+ 8 - 5
mcs/class/System.Web/Test/System.Web.UI.WebControls/UnitTest.cs

@@ -36,9 +36,9 @@ using System.Web.UI.WebControls;
 
 namespace MonoTests.System.Web.UI.WebControls
 {
-	[TestFixture]	
-	public class UnitTest {
-
+	[TestFixture]
+	public class UnitTest
+	{
 		[Test]
 		public void UnitConstructors ()
 		{
@@ -166,6 +166,11 @@ namespace MonoTests.System.Web.UI.WebControls
 			a3 = new Unit (1.5);
 			Assert.AreEqual (UnitType.Pixel, a3.Type, "A58");
 			Assert.AreEqual (1.0, a3.Value, "A59");
+
+			s1 = new Unit (".9em");
+			Assert.AreEqual (s1.Type, UnitType.Em, "B1");
+			Assert.AreEqual (s1.Value, 0.9, "B2");
+			Assert.AreEqual ("0.9em", s1.ToString (), "B3");
 		}
 
 		[Test]
@@ -273,7 +278,6 @@ namespace MonoTests.System.Web.UI.WebControls
 		{
 		    // throws because floating point values are not valid for Pixel.
 		    Unit a = new Unit("34.4px");
-	            
 		}
 
 		[Test]
@@ -392,4 +396,3 @@ namespace MonoTests.System.Web.UI.WebControls
 	}
 }
 
-