Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -347,11 +347,7 @@ namespace MonoTests.System.Web.Script.Serialization
[Category ("NotDotNet")]
public void TestDefaults () {
JavaScriptSerializer ser = new JavaScriptSerializer ();
#if NET_3_5
Assert.AreEqual (2097152, ser.MaxJsonLength);
#else
Assert.AreEqual (102400, ser.MaxJsonLength);
#endif
Assert.AreEqual (100, ser.RecursionLimit);
//List<JavaScriptConverter> l = new List<JavaScriptConverter> ();
//l.Add (new MyJavaScriptConverter ());
@@ -415,6 +411,22 @@ namespace MonoTests.System.Web.Script.Serialization
//object oo = ser.DeserializeObject ("{value:'Purple\\r \\n monkey\\'s:\\tdishwasher'}");
}
[Test]
public void TestDeserializeNonGenericOverload()
{
JavaScriptSerializer ser = new JavaScriptSerializer();
Assert.IsNull(ser.Deserialize("", typeof(X)));
X s = new X();
s.Init();
string x = ser.Serialize(s);
Assert.AreEqual("{\"z\":8,\"ch\":\"ď˝–\",\"ch_null\":null,\"str\":\"ď˝–ď˝—ď–ŹF59g\",\"b\":253,\"sb\":-48,\"sh\":-32740,\"ush\":65511,\"i\":-234235453,\"ui\":4294733061,\"l\":-9223372036854775780,\"ul\":18446744073709551612,\"f\":NaN,\"f1\":-Infinity,\"f2\":Infinity,\"f3\":-3.40282347E+38,\"f4\":3.40282347E+38,\"d\":NaN,\"d1\":-Infinity,\"d2\":Infinity,\"d3\":-1.7976931348623157E+308,\"d4\":1.7976931348623157E+308,\"de\":-1,\"de1\":0,\"de2\":1,\"de3\":-79228162514264337593543950335,\"de4\":79228162514264337593543950335,\"g\":\"000000ea-0002-0162-0102-030405060708\",\"nb\":null,\"dbn\":null,\"uri\":\"http://kostat@mainsoft/adfasdf/asdfasdf.aspx/asda/ads?a=b&c=d\",\"hash\":{\"mykey\":{\"BB\":10}},\"point\":{\"IsEmpty\":false,\"X\":150,\"Y\":150},\"MyEnum\":[1,10,345],\"MyEnum1\":[1,10,345],\"AA\":5,\"AA1\":[{\"BB\":10},{\"BB\":10}],\"BB\":18446744073709551610,\"YY\":[{\"BB\":10},{\"BB\":10}]}", x, "#A1");
X n = ser.Deserialize(x, typeof(X)) as X;
Assert.AreEqual(s, n, "#A2");
}
[Test]
public void TestDeserializeTypeResolver ()
{

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -222,4 +221,3 @@ namespace MonoTests.System.Web.UI.WebControls
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -55,4 +54,3 @@ namespace MonoTests.System.Web.UI.WebControls
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections;
using System.Collections.Generic;
@@ -229,4 +228,3 @@ namespace MonoTests.System.Web.UI.WebControls
}
}
}
#endif

View File

@@ -27,7 +27,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_3_5
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -1322,4 +1321,3 @@ namespace MonoTests.System.Web.UI.WebControls
}
}
}
#endif