Imported Upstream version 5.10.0.47

Former-commit-id: d0813289fa2d35e1f8ed77530acb4fb1df441bc0
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-01-24 17:04:36 +00:00
parent 88ff76fe28
commit e46a49ecf1
5927 changed files with 226314 additions and 129848 deletions

View File

@ -91,12 +91,10 @@ namespace MonoTests.System.Web.Caching
static CacheItemPriorityQueueTest ()
{
dataDir =
Path.Combine (
Path.Combine (
Path.Combine (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location), "Test"),
"System.Web.Caching"),
DATA_DIR);
// Assumes this is compiled into mcs/class/lib/<profile>/test
string class_dir = Directory.GetParent (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location)).Parent.Parent.FullName;
string system_web_dir = Path.Combine (class_dir, "System.Web", "Test", "System.Web.Caching");
dataDir = Path.Combine (system_web_dir, DATA_DIR);
}
void RunTest (string testsFileName, string listFileName)

View File

@ -33,7 +33,6 @@ using System.Web;
using System.Web.Caching;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -45,15 +44,15 @@ namespace MonoTests.System.Web.Caching
{
FileResponseElement fre;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
fre = new FileResponseElement (null, 0, 0);
}, "#A1");
AssertExtensions.Throws<ArgumentOutOfRangeException> (() => {
Assert.Throws<ArgumentOutOfRangeException> (() => {
fre = new FileResponseElement ("file.txt", -1, 0);
}, "#A2");
AssertExtensions.Throws<ArgumentOutOfRangeException> (() => {
Assert.Throws<ArgumentOutOfRangeException> (() => {
fre = new FileResponseElement ("file.txt", 0, -1);
}, "#A3");

View File

@ -33,7 +33,6 @@ using System.Web;
using System.Web.Caching;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -45,11 +44,11 @@ namespace MonoTests.System.Web.Caching
{
HeaderElement he;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
he = new HeaderElement (null, String.Empty);
}, "#A1");
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
he = new HeaderElement ("Header", null);
}, "#A2");

View File

@ -33,7 +33,7 @@ using System.Web;
using System.Web.Caching;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -45,15 +45,15 @@ namespace MonoTests.System.Web.Caching
{
MemoryResponseElement mre;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
mre = new MemoryResponseElement (null, 0);
}, "#A1");
AssertExtensions.Throws<ArgumentOutOfRangeException> (() => {
Assert.Throws<ArgumentOutOfRangeException> (() => {
mre = new MemoryResponseElement (new byte[1], -1);
}, "#A2");
AssertExtensions.Throws<ArgumentOutOfRangeException> (() => {
Assert.Throws<ArgumentOutOfRangeException> (() => {
mre = new MemoryResponseElement (new byte[1], 2);
}, "#A2");

View File

@ -36,7 +36,6 @@ using System.Web.Caching;
using System.Web.Configuration;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -166,17 +165,17 @@ namespace MonoTests.System.Web.Caching
{
ResponseElement data = new MemoryResponseElement (new byte[10], 10);
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
OutputCache.Serialize (null, data);
}, "#A1");
var ms = new MemoryStream ();
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
OutputCache.Serialize (ms, null);
}, "#A2");
foreach (object o in serializeObjects) {
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
OutputCache.Serialize (ms, o);
}, String.Format ("#A3-{0}", o.GetType ()));
}
@ -194,28 +193,28 @@ namespace MonoTests.System.Web.Caching
#endif
byte[] bytes = SerializeElement (mre);
AssertExtensions.AreEqual (bytes, memoryResponseElement, "#B1");
Assert.AreEqual (bytes, memoryResponseElement, "#B1");
bytes = SerializeElement (fre);
AssertExtensions.AreEqual (bytes, fileResponseElement, "#B2");
Assert.AreEqual (bytes, fileResponseElement, "#B2");
bytes = SerializeElement (sre);
AssertExtensions.AreEqual (bytes, substitutionResponseElement, "#B3");
Assert.AreEqual (bytes, substitutionResponseElement, "#B3");
bytes = SerializeElement (sreBad);
AssertExtensions.AreEqual (bytes, badSubstitutionResponseElement, "#B4");
Assert.AreEqual (bytes, badSubstitutionResponseElement, "#B4");
}
[Test]
public void Deserialize ()
{
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
OutputCache.Deserialize (null);
}, "#A1");
foreach (object o in serializeObjects) {
using (var m = new MemoryStream (SerializeToBinary (o))) {
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
OutputCache.Deserialize (m);
}, String.Format ("#A2-{0}", o.GetType ()));
}
@ -231,7 +230,7 @@ namespace MonoTests.System.Web.Caching
using (ms = new MemoryStream (memoryResponseElement))
mreOrig = OutputCache.Deserialize (ms) as MemoryResponseElement;
Assert.IsNotNull (mreOrig, "#B1-1");
AssertExtensions.AreEqual (mreOrig.Buffer, mre.Buffer, "#B1-2");
Assert.AreEqual (mreOrig.Buffer, mre.Buffer, "#B1-2");
Assert.AreEqual (mreOrig.Length, mre.Length, "#B1-3");
using (ms = new MemoryStream (fileResponseElement))
@ -247,7 +246,7 @@ namespace MonoTests.System.Web.Caching
Assert.AreEqual (sreOrig.Callback, sre.Callback, "#D1");
// Callback here is not a static method - Substitution delegates must be static
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
using (ms = new MemoryStream (badSubstitutionResponseElement))
sreBadOrig = OutputCache.Deserialize (ms) as SubstitutionResponseElement;
}, "#E1");

View File

@ -30,7 +30,6 @@ using System.Web;
using System.Web.Caching;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -41,7 +40,7 @@ namespace MonoTests.System.Web.Caching
public void Constructor_1 ()
{
SqlCacheDependency sqc;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
sqc = new SqlCacheDependency (null);
}, "#A1");
}
@ -51,16 +50,16 @@ namespace MonoTests.System.Web.Caching
{
SqlCacheDependency sqc;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
sqc = new SqlCacheDependency (null, "myTable");
}, "#A1");
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
sqc = new SqlCacheDependency ("myDatabase", null);
}, "#A2");
// Cannot be tested without an existing database
//AssertExtensions.Throws<ArgumentNullException> (() => {
//Assert.Throws<ArgumentNullException> (() => {
// sqc = new SqlCacheDependency ("myDatabase", "myTable");
//}, "#A3");
}
@ -70,15 +69,15 @@ namespace MonoTests.System.Web.Caching
{
CacheDependency sqc;
AssertExtensions.Throws<HttpException> (() => {
Assert.Throws<HttpException> (() => {
sqc = SqlCacheDependency.CreateOutputCacheDependency (null);
}, "#A1");
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
sqc = SqlCacheDependency.CreateOutputCacheDependency (String.Empty);
}, "#A2");
AssertExtensions.Throws<ArgumentException> (() => {
Assert.Throws<ArgumentException> (() => {
sqc = SqlCacheDependency.CreateOutputCacheDependency ("Database");
}, "#A2");

View File

@ -33,7 +33,6 @@ using System.Web;
using System.Web.Caching;
using NUnit.Framework;
using MonoTests.Common;
namespace MonoTests.System.Web.Caching
{
@ -50,7 +49,7 @@ namespace MonoTests.System.Web.Caching
{
SubstitutionResponseElement sre;
AssertExtensions.Throws<ArgumentNullException> (() => {
Assert.Throws<ArgumentNullException> (() => {
sre = new SubstitutionResponseElement (null);
}, "#A1");