2009-11-09 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Mon, 9 Nov 2009 13:36:18 +0000 (13:36 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Mon, 9 Nov 2009 13:36:18 +0000 (13:36 -0000)
* HttpCookieTest.cs: added test for bug #553063

2009-11-09  Marek Habersack  <mhabersack@novell.com>

* HttpCookie.cs: made HttpCookie.CookieNVC serializable. Patch
from Sean Foy <sean.foy+novell@gmail.com>, thanks! Fixes bug
#553063

svn path=/trunk/mcs/; revision=145735

mcs/class/System.Web/System.Web/ChangeLog
mcs/class/System.Web/System.Web/HttpCookie.cs
mcs/class/System.Web/Test/System.Web/ChangeLog
mcs/class/System.Web/Test/System.Web/HttpCookieTest.cs

index 96a9fb81d2b1a5cce21ae1c65bbe8e96c3745087..ff2a1ed196a5636e61c1c38c1eeb3e5d13629ab4 100644 (file)
@@ -1,5 +1,9 @@
 2009-11-09  Marek Habersack  <mhabersack@novell.com>
 
+       * HttpCookie.cs: made HttpCookie.CookieNVC serializable. Patch
+       from Sean Foy <sean.foy+novell@gmail.com>, thanks! Fixes bug
+       #553063
+
        * HttpCookieCollection.cs: Add allows for duplicate cookie
        names. Fixes bug #553150
 
index 43909365e99491937c3fb7a431daead2b2f65ff5..19d604060620be36ce9944b53365141a8db0adff 100644 (file)
@@ -224,6 +224,7 @@ namespace System.Web
                 * to get the desired behavior for
                 * HttpCookie.Values
                 */
+               [Serializable]
                sealed class CookieNVC : NameValueCollection
                {
                        public CookieNVC ()
index 60674db52f016361f04f13f3a4cf34946b1ed2ec..d35c4f3f9224d58e2dfd0b33877d370b560370a3 100644 (file)
@@ -1,5 +1,7 @@
 2009-11-09  Marek Habersack  <mhabersack@novell.com>
 
+       * HttpCookieTest.cs: added test for bug #553063
+
        * HttpCookieCollectionTest.cs: added test for bug #553150
 
 2009-09-07  Marek Habersack  <mhabersack@novell.com>
index 8417e4efc063106c14cafabad9c6f7dfbaadcb81..169848779b895e8cb1a8a795beb035efedcbd235 100644 (file)
@@ -27,6 +27,8 @@
 //
 
 using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
 using System.Web;
 
 using NUnit.Framework;
@@ -65,6 +67,18 @@ namespace MonoTests.System.Web {
                        Assert.IsFalse (cookie.HasKeys);
                }
 
+               [Test (Description="Bug #553063")]
+               public void CookieValuesSerialization ()
+               {
+                       BinaryFormatter bf = new BinaryFormatter();
+                       HttpCookie c = new HttpCookie ("stuff", "value1");
+               
+                       using (var ms = new MemoryStream()) {
+                               bf.Serialize(ms, c.Values);
+                               ms.Seek(0, SeekOrigin.Begin);
+                       }
+               }
+               
                [Test]
                public void PropertySetters ()
                {