Author: igorz
Date: 2006-11-22 04:59:31 -0500 (Wed, 22 Nov 2006)
New Revision: 68335
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/QueryStringParameter.cs
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SessionParameter.cs
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ParameterTest.cs
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/QueryStringParameterTest.cs
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
Log:
2006-11-22 Igor Zelmanovich <[EMAIL PROTECTED]>
* Parameter.cs: fixed Evaluate, ToString methods.
* QueryStringParameter.cs: fixed Evaluate method.
* SessionParameter.cs: fixed Evaluate method.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-11-22 09:28:38 UTC (rev 68334)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
2006-11-22 09:59:31 UTC (rev 68335)
@@ -1,3 +1,9 @@
+2006-11-22 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * Parameter.cs: fixed Evaluate, ToString methods.
+ * QueryStringParameter.cs: fixed Evaluate method.
+ * SessionParameter.cs: fixed Evaluate method.
+
2006-11-21 Igor Zelmanovich <[EMAIL PROTECTED]>
* ImageMap.cs: fixed rendering.
Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/Parameter.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -121,11 +121,10 @@
get { return this.IsTrackingViewState; }
}
+ // MSDN: The ToString method returns the Name property of the
Parameter object. If the Parameter object has no name, ToString returns
String.Empty.
public override string ToString ()
{
- object o = GetValue (HttpContext.Current, null);
- if (o != null) return o.ToString();
- return "";
+ return Name;
}
[WebCategoryAttribute ("Parameter")]
@@ -237,9 +236,16 @@
get { return isTrackingViewState; }
}
+ // MSDN: The default implementation of the Evaluate method is
to return
+ // a null reference (Nothing in Visual Basic) in all cases.
+ // Classes that derive from the Parameter class override the
Evaluate method
+ // to return an updated parameter value. For example, the
ControlParameter object
+ // returns the value of the control that it is bound to, while
+ // the QueryStringParameter object retrieves the current
name/value pair from
+ // the HttpRequest object.
protected virtual object Evaluate (HttpContext context, Control
control)
{
- return this.DefaultValue;
+ return null;
}
internal object GetValue (HttpContext context, Control control)
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/QueryStringParameter.cs
===================================================================
---
trunk/mcs/class/System.Web/System.Web.UI.WebControls/QueryStringParameter.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++
trunk/mcs/class/System.Web/System.Web.UI.WebControls/QueryStringParameter.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -66,7 +66,7 @@
protected override object Evaluate (HttpContext ctx, Control
control)
{
- if (control == null || ctx.Request == null)
+ if (ctx == null || ctx.Request == null)
return null;
return ctx.Request.QueryString [QueryStringField];
@@ -92,3 +92,4 @@
}
#endif
+
Modified:
trunk/mcs/class/System.Web/System.Web.UI.WebControls/SessionParameter.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/SessionParameter.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/SessionParameter.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -65,7 +65,7 @@
protected override object Evaluate (HttpContext ctx, Control
control)
{
- if (control == null || ctx.Session == null)
+ if (ctx == null || ctx.Session == null)
return null;
return ctx.Session [SessionField];
@@ -92,3 +92,4 @@
}
#endif
+
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-22 09:28:38 UTC (rev 68334)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
2006-11-22 09:59:31 UTC (rev 68335)
@@ -1,3 +1,9 @@
+2006-11-22 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+ * ParameterTest.cs: removed NotWorking attributes.
+ * QueryStringParameterTest.cs: removed NotWorking attributes.
+ * SessionParameterTest.cs: removed NotWorking attributes.
+
2006-11-21 Igor Zelmanovich <[EMAIL PROTECTED]>
* ImageMapTest.cs: removed NotWorking attributes.
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ParameterTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ParameterTest.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ParameterTest.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -203,7 +203,6 @@
//Public methods
[Test]
- [Category("NotWorking")]
public void Parameter_ToString ()
{
ParameterPoker param = new ParameterPoker
("ID",TypeCode.String ,"1001");
@@ -229,7 +228,6 @@
[Test]
[Category ("NunitWeb")]
- [Category("NotWorking")]
public void Parameter_Evaluate ()
{
string html = new WebTest (PageInvoker.CreateOnLoad (
@@ -249,7 +247,6 @@
}
[Test]
- [Category("NotWorking")]
public void Parameter_DoSetDirty ()
{
ParameterPoker param = new ParameterPoker ("ID",
TypeCode.String, "1001");
@@ -257,8 +254,7 @@
Assert.AreEqual (null, state, "BeforeSetDirtyMethod");
param.DoSetDirty ();
state = param.SaveState ();
- Assert.AreEqual(6, ((ArrayList)state).Count ,
"AfterSetDirtyMethod1");
- Assert.AreEqual ("ID", ((ArrayList) state)[1],
"AfterSetDirtyMethod2");
+ Assert.IsTrue (null != state, "AfterSetDirtyMethod1");
}
[Test]
@@ -280,4 +276,4 @@
}
}
}
-#endif
\ No newline at end of file
+#endif
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/QueryStringParameterTest.cs
===================================================================
---
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/QueryStringParameterTest.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/QueryStringParameterTest.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -133,7 +133,6 @@
}
[Test]
- [Category("NotWorking")]
public void QueryStringParameter_Evaluate()
{
QueryStringParameterPoker queryParam = new
QueryStringParameterPoker("Employee", TypeCode.Int32, "id");
@@ -146,7 +145,9 @@
HttpContext context = new HttpContext(request,
response);
value = (string)queryParam.DoEvaluate(context, tb);
Assert.AreEqual("332", value, "EvaluateQueryString1");
- request = new HttpRequest(String.Empty,
"http://www.mono-project.com", "id=500");
+ value = (string) queryParam.DoEvaluate (context, null);
+ Assert.AreEqual ("332", value, "EvaluateQueryString1");
+ request = new HttpRequest (String.Empty,
"http://www.mono-project.com", "id=500");
context = new HttpContext(request, response);
value = (string)queryParam.DoEvaluate(context, tb);
Assert.AreEqual("500", value, "EvaluateQueryString2");
@@ -156,4 +157,4 @@
}
}
-#endif
\ No newline at end of file
+#endif
Modified:
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
===================================================================
---
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
2006-11-22 09:28:38 UTC (rev 68334)
+++
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/SessionParameterTest.cs
2006-11-22 09:59:31 UTC (rev 68335)
@@ -135,7 +135,6 @@
[Test]
[Category("NunitWeb")]
- [Category("NotWorking")]
public void SessionParameter_Evaluate()
{
SessionParameterPoker sessionParam = new
SessionParameterPoker("employee",TypeCode.String ,"id") ;
@@ -171,4 +170,4 @@
}
}
-#endif
\ No newline at end of file
+#endif
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches