Kaynağa Gözat

Implemented FontInfo.ShouldSerializeNames and its Tests.

svn path=/trunk/mcs/; revision=58638
Alexandre Gomes 20 yıl önce
ebeveyn
işleme
375e78a210

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

@@ -1,3 +1,7 @@
+2006-03-28  Alexandre Miguel Pedro Gomes  <[email protected]>
+ 
+ 	* FontInfo.cs: Implemented ShouldSerializeNames
+ 
 2006-03-23  Vladimir Krasnov  <[email protected]>
 
 	* DataGrid.cs, DataList.cs, RepeatInfo.cs: added accessablity features

+ 1 - 2
mcs/class/System.Web/System.Web.UI.WebControls/FontInfo.cs

@@ -392,10 +392,9 @@ namespace System.Web.UI.WebControls {
 			}
 		}
 
-		[MonoTODO]
 		public bool ShouldSerializeNames() 
 		{
-			throw new NotImplementedException("Microsoft Internal, not sure what to do");
+			return (Names.Length != 0);
 		}
 
 		public override string ToString() 

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

@@ -1,3 +1,7 @@
+2006-03-28  Alexandre Miguel Pedro Gomes  <[email protected]>
+ 
+ 	* FontInfoTest.cs: Implemented ShouldSerializeNames tests
+
 2006-03-06  Vladimir Krasnov  <[email protected]>
 
 	* CalendarTest.cs: refactoring, inline delegates replaced with

+ 12 - 0
mcs/class/System.Web/Test/System.Web.UI.WebControls/FontInfoTest.cs

@@ -62,6 +62,18 @@ namespace MonoTests.System.Web.UI.WebControls
 			Assert.AreEqual (s.Width, Unit.Empty, "Default8");
 		}
 
+		[Test]
+		public void ShouldSerializeNames ()
+		{
+			Style style = new Style ();
+			FontInfo fontInfo = style.Font;
+			Assert.IsFalse (fontInfo.ShouldSerializeNames ());
+			fontInfo.Name = "Verdana";
+			Assert.IsTrue (fontInfo.ShouldSerializeNames ());
+			fontInfo.Name = String.Empty;
+			Assert.IsFalse (fontInfo.ShouldSerializeNames ());
+		}
+
 		[Test]
 		public void Style_Merge ()
 		{