Author: dna
Date: 2008-02-09 06:49:28 -0500 (Sat, 09 Feb 2008)
New Revision: 95323
Modified:
trunk/mcs/class/System/System.Net/ChangeLog
trunk/mcs/class/System/System.Net/Cookie.cs
trunk/mcs/class/System/Test/System.Net/ChangeLog
trunk/mcs/class/System/Test/System.Net/CookieTest.cs
Log:
2008-02-09 Daniel Nauck <[EMAIL PROTECTED]>
* Cookie.cs: implemented HttpOnly
* CookieTest.cs: added tests for public fields
Modified: trunk/mcs/class/System/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/System.Net/ChangeLog 2008-02-09 10:31:22 UTC (rev
95322)
+++ trunk/mcs/class/System/System.Net/ChangeLog 2008-02-09 11:49:28 UTC (rev
95323)
@@ -1,3 +1,7 @@
+2008-02-09 Daniel Nauck <[EMAIL PROTECTED]>
+
+ * Cookie.cs: implemented HttpOnly
+
2008-01-27 Gert Driesen <[EMAIL PROTECTED]>
* IPAddress.cs (Parse): Changed argument name to match MS.
Modified: trunk/mcs/class/System/System.Net/Cookie.cs
===================================================================
--- trunk/mcs/class/System/System.Net/Cookie.cs 2008-02-09 10:31:22 UTC (rev
95322)
+++ trunk/mcs/class/System/System.Net/Cookie.cs 2008-02-09 11:49:28 UTC (rev
95323)
@@ -4,6 +4,7 @@
// Authors:
// Lawrence Pit ([EMAIL PROTECTED])
// Gonzalo Paniagua Javier ([EMAIL PROTECTED])
+// Daniel Nauck (dna(at)mono-project(dot)de)
//
// (c) Copyright 2004 Novell, Inc. (http://www.ximian.com)
//
@@ -49,6 +50,7 @@
string domain;
bool expired;
DateTime expires;
+ bool httpOnly;
string name;
string path;
string port;
@@ -66,6 +68,7 @@
{
expires = DateTime.MinValue;
timestamp = DateTime.Now;
+ httpOnly = false;
domain = "";
name = "";
val = "";
@@ -117,11 +120,9 @@
return expires <= DateTime.Now &&
expires != DateTime.MinValue;
}
- set {
- expired = value;
- if (expired) {
+ set {
+ if (value)
expires = DateTime.Now;
- }
}
}
@@ -130,21 +131,11 @@
set { expires = value; }
}
-#if NET_2_0
- static Exception GetMustImplement ()
- {
- return new NotImplementedException ();
- }
-
- [MonoTODO]
+#if NET_2_0
public bool HttpOnly
{
- get {
- throw GetMustImplement ();
- }
- set {
- throw GetMustImplement ();
- }
+ get { return httpOnly; }
+ set { httpOnly = value; }
}
#endif
Modified: trunk/mcs/class/System/Test/System.Net/ChangeLog
===================================================================
--- trunk/mcs/class/System/Test/System.Net/ChangeLog 2008-02-09 10:31:22 UTC
(rev 95322)
+++ trunk/mcs/class/System/Test/System.Net/ChangeLog 2008-02-09 11:49:28 UTC
(rev 95323)
@@ -1,3 +1,7 @@
+2008-02-09 Daniel Nauck <[EMAIL PROTECTED]>
+
+ * CookieTest.cs: added tests for public fields
+
2008-01-27 Gert Driesen <[EMAIL PROTECTED]>
* IPAddressTest.cs: Remove use of deprecated Assertion. Improved
Modified: trunk/mcs/class/System/Test/System.Net/CookieTest.cs
===================================================================
--- trunk/mcs/class/System/Test/System.Net/CookieTest.cs 2008-02-09
10:31:22 UTC (rev 95322)
+++ trunk/mcs/class/System/Test/System.Net/CookieTest.cs 2008-02-09
11:49:28 UTC (rev 95323)
@@ -22,6 +22,30 @@
[Test]
public void PublicFields ()
{
+ Cookie c = new Cookie ();
+ Assert.AreEqual (string.Empty, c.Name, "#A1");
+ Assert.AreEqual (string.Empty, c.Value, "#A2");
+ Assert.AreEqual (string.Empty, c.Domain, "#A3");
+ Assert.AreEqual (string.Empty, c.Port, "#A4");
+ Assert.AreEqual (string.Empty, c.Comment, "#A5");
+ Assert.AreEqual (null, c.CommentUri, "#A6");
+ Assert.IsFalse (c.Discard, "#A7");
+ Assert.IsFalse (c.Expired, "#A8");
+ Assert.AreEqual (DateTime.MinValue, c.Expires, "#A9");
+ Assert.IsFalse (c.HttpOnly, "#A10");
+ Assert.AreEqual (string.Empty, c.Path, "#A11");
+ Assert.IsFalse (c.Secure, "#A12");
+ Assert.AreEqual (0, c.Version, "#A13");
+ Assert.AreEqual (string.Empty, c.ToString (), "#A14");
+
+ c.Expires = DateTime.Now;
+ Assert.IsTrue (c.Expired, "#A15");
+
+ c.Port = null;
+ Assert.AreEqual (string.Empty, c.Port, "#A16");
+
+ c.Value = null;
+ Assert.AreEqual (string.Empty, c.Value, "#A17");
}
[Test]
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches