Author: krasnov
Date: 2006-11-13 10:49:36 -0500 (Mon, 13 Nov 2006)
New Revision: 67762

Modified:
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginViewTest.cs
Log:
* LoginTest.cs: login tests converted to webtest
* LoginViewTest.cs: removed NotWorking attributes


Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-13 15:46:32 UTC (rev 67761)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-11-13 15:49:36 UTC (rev 67762)
@@ -1,3 +1,8 @@
+2006-11-13  Vladimir Krasnov  <[EMAIL PROTECTED]>
+
+       * LoginTest.cs: login tests converted to webtest
+       * LoginViewTest.cs: removed NotWorking attributes
+
 2006-11-13  Igor Zelmanovich   <[EMAIL PROTECTED]>
 
        * CompositeDataBoundControlTest.cs: added tests.

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs      
2006-11-13 15:46:32 UTC (rev 67761)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginTest.cs      
2006-11-13 15:49:36 UTC (rev 67762)
@@ -36,6 +36,8 @@
 using System.Web.UI.WebControls;
 
 using NUnit.Framework;
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
 
 namespace MonoTests.System.Web.UI.WebControls {
        
@@ -793,11 +795,19 @@
                }
 
                [Test]
+               [Category ("NunitWeb")]
                public void OnBubbleEvent ()
                {
+                       WebTest t = new WebTest (PageInvoker.CreateOnPreInit 
(_OnBubbleEvent));
+                       string html = t.Run ();
+               }
+
+               public static void _OnBubbleEvent(Page p)
+               {
                        TestLogin l = new TestLogin ();
-                       l.Page = new Page ();
+                       l.Page = p;
                        l.Page.Validate ();
+                       l.MembershipProvider = "FakeProvider";
                        Button b = (Button)l.FindControl ("LoginButton");
                        Assert.IsNotNull (b, "LoginButton");
                        CommandEventArgs cea = new CommandEventArgs ("Login", 
null);
@@ -830,14 +840,22 @@
                [Test]
                public void OnBubbleEvent_Authenticated_OnAuthenticate ()
                {
+                       WebTest t = new WebTest (PageInvoker.CreateOnPreInit 
(_OnBubbleEvent_Authenticated_OnAuthenticate));
+                       string html = t.Run ();
+               }
+
+               public static void _OnBubbleEvent_Authenticated_OnAuthenticate 
(Page p)
+               {
                        TestLogin l = new TestLogin ();
-                       l.Page = new Page ();
+                       l.Page = p;
                        l.Page.Validate ();
-                       Button b = (Button)l.FindControl ("LoginButton");
+                       Button b = (Button) l.FindControl ("LoginButton");
                        Assert.IsNotNull (b, "LoginButton");
                        CommandEventArgs cea = new CommandEventArgs ("Login", 
null);
                        l.UserName = "me";
                        l.Authenticated = true;
+                       l.MembershipProvider = "FakeProvider";
+                       l.Authenticate += new 
AuthenticateEventHandler(l_Authenticate);
                        try {
                                l.DoBubbleEvent (b, cea);
                        }
@@ -849,6 +867,16 @@
                        }
                }
 
+               public static void l_Authenticate (object sender, 
AuthenticateEventArgs e)
+               {
+                       if (e.Authenticated == true) {
+                               TestLogin l = (TestLogin) sender;
+                               l.Authenticated = false;
+                       }
+                       else
+                               Assert.Fail ("Login failed: l_Authenticate");
+               }
+
                private void OnLoggingIn (bool cancel)
                {
                        TestLogin l = new TestLogin ();

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginViewTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginViewTest.cs  
2006-11-13 15:46:32 UTC (rev 67761)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/LoginViewTest.cs  
2006-11-13 15:49:36 UTC (rev 67762)
@@ -122,7 +122,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void LoginView_DefaultPropertiesNotWorking ()
                {
                        LoginView l = new LoginView ();
@@ -158,7 +157,6 @@
                }
 
                [Test]
-               [Category("NotWorking")]
                public void LoginView_LoggedInTemplate ()
                {
                        TestLoginView l = new TestLoginView ();
@@ -187,7 +185,6 @@
 
                [Test]
                [Category ("NunitWeb")]
-               [Category ("NotWorking")]
                // This test is not compleated , must be continued after adding 
                // possibilities to test framework (cookies and redirect)
                public void LoginView_Render ()
@@ -227,7 +224,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")]
                public void LoginView_PreRender ()
                {
                        TestLoginView l = new TestLoginView ();

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

Reply via email to