Author: krasnov
Date: 2006-07-16 10:19:21 -0400 (Sun, 16 Jul 2006)
New Revision: 62659

Modified:
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
Log:
* BoundFieldTest.cs: added new test


Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs 
2006-07-16 14:13:03 UTC (rev 62658)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/BoundFieldTest.cs 
2006-07-16 14:19:21 UTC (rev 62659)
@@ -41,7 +41,9 @@
 using System.Collections.Specialized;
 using Image = System.Web.UI.WebControls.Image;
 using NUnit.Framework;
-using System.Globalization;
+using System.Globalization;
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
 
 
 
@@ -99,9 +101,10 @@
                public Control GetControl {
                        get { return base.Control; }
                }
-       }
-
-
+       }
+
+
+       [Serializable]
        [TestFixture]
        public class BoundFieldTest
        {
@@ -358,8 +361,77 @@
                public void BoundField_GetValueExeption () {
                        PokerBoundField bf = new PokerBoundField ();
                        bf.DoGetValue (null);
-               }
-
+               }
+
+               [Test]
+               [Category ("NunitWeb")]
+               public void BoundField_NullValueRender ()
+               {
+                       string html = new WebTest (PageInvoker.CreateOnLoad 
(new PageDelegate (BasicRenderTestInit))).Run ();
+                       string orightml = @"<div>
+                               <table cellspacing=""0"" rules=""all"" 
border=""1"" id=""GridView1"" style=""border-collapse:collapse;"">
+                                       <tr>
+                                               <th 
scope=""col"">&nbsp;</th><th scope=""col"">&nbsp;</th>
+                                       </tr><tr>
+                                               <td>Norway</td><td>Norway</td>
+                                       </tr><tr>
+                                               <td>Sweden</td><td>Sweden</td>
+                                       </tr><tr>
+                                               <td>EMPTY</td><td>&nbsp;</td>
+                                       </tr><tr>
+                                               <td>Italy</td><td>Italy</td>
+                                       </tr>
+                               </table>
+                               </div>";
+                       html = HtmlDiff.GetControlFromPageHtml (html);
+                       HtmlDiff.AssertAreEqual (orightml, html, 
"NullValueRender");
+               }
+
+               private void BasicRenderTestInit (Page p)
+               {
+                       ArrayList myds = new ArrayList ();
+                       myds.Add (new myds_data ("Norway"));
+                       myds.Add (new myds_data ("Sweden"));
+                       myds.Add (new myds_data (""));
+                       myds.Add (new myds_data ("Italy"));
+
+                       BoundField bf = new BoundField ();
+                       bf.DataField = "Field1";
+                       bf.NullDisplayText = "EMPTY";
+
+                       BoundField bf2 = new BoundField ();
+                       bf2.DataField = "Field1";
+
+                       GridView GridView1 = new GridView();
+                       GridView1.AutoGenerateColumns = false;
+                       GridView1.Columns.Add (bf);
+                       GridView1.Columns.Add (bf2);
+                       GridView1.DataSource = myds;
+                       GridView1.DataBind ();
+
+                       LiteralControl lcb = new LiteralControl 
(HtmlDiff.BEGIN_TAG);
+                       LiteralControl lce = new LiteralControl 
(HtmlDiff.END_TAG);
+
+                       p.Form.Controls.Add (lcb);
+                       p.Form.Controls.Add (GridView1);
+                       p.Form.Controls.Add (lce);
+               }
+
+               class myds_data
+               {
+                       string _s = "";
+                       public myds_data (string s)
+                       {
+                               _s = s;
+                       }
+
+                       public string Field1
+                       {
+                               get { return _s; }
+                       }
+               }
+
+               
                class ControlWithDataItem : Control
                {
                        readonly object _data;

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-07-16 14:13:03 UTC (rev 62658)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-07-16 14:19:21 UTC (rev 62659)
@@ -1,3 +1,7 @@
+2006-07-16 Vladimir Krasnov <[EMAIL PROTECTED]>
+
+       * BoundFieldTest.cs: added new test
+
 2006-07-16 Andrew Skiba <[EMAIL PROTECTED]>
 
        * SiteMapPathTest.cs: fix expected results for dotnet in 3 tests;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to