Author: andrews
Date: 2006-07-11 05:30:52 -0400 (Tue, 11 Jul 2006)
New Revision: 62430
Modified:
trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/README
Log:
readme update
Modified: trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/README
===================================================================
--- trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/README
2006-07-11 09:22:56 UTC (rev 62429)
+++ trunk/mcs/class/System.Web/Test/mainsoft/NunitWeb/NunitWeb/README
2006-07-11 09:30:52 UTC (rev 62430)
@@ -30,3 +30,40 @@
Assert.AreEqual ("White", p.StyleSheetTheme);
}
+There is a support for postback. The flow goes like this: you make a first
+request like:
+
+WebTest t = new WebTest ("SomePage.aspx");
+t.Run ();
+
+Then you use the response to create a FormRequest:
+
+FormRequest f = new FormRequest (t.Response);
+
+This will parse the response, and use action URL, GET/POST method and all
+hidden fields (VIEWSTATE, etc.) You might add more query parameters, like
+
+f.Controls.Add (new BaseControl ("button1", ""));
+f.Controls.Add (new BaseControl ("textbox1", "some text");
+
+and run the second request:
+
+t.Request = f;
+t.Run ();
+
+It can be useful to install some callbacks for the second request, before
+calling to t.Run(), like the following:
+
+t.Invoker = PageInvoker.CreateOnLoad (MyDelegate);
+
+the delegate for the above test might look like:
+
+t.Invoker = PageInvoker.CreateOnLoad (MyDelegate);
+
+static public void MyDelegate (Page p)
+{
+ Assert.IsTrue (p.IsPostBack);
+ Assert.AreEqual ("some text", ((TextControl)p.FindControl
("textbox1")).Text);
+}
+
+
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches