Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@ -779,6 +779,14 @@ public class ArrayTest
Array.CreateInstance (typeof (Int32), (long[])null);
}
[Test]
public void CreateInstanceVoid ()
{
Assert.Throws<NotSupportedException> (delegate () {
Array.CreateInstance (typeof (void), 1);
});
}
[Test]
public void TestGetEnumerator() {
String[] s1 = {"this", "is", "a", "test"};
@ -995,7 +1003,6 @@ public class ArrayTest
int[] myBoundArray = new int[1] { Int32.MinValue };
Array myExtremeArray=Array.CreateInstance ( typeof(String), myLengthArray, myBoundArray );
Assert.AreEqual (Int32.MaxValue, ((IList)myExtremeArray).IndexOf (42), "AD04");
}
[Test]
@ -2575,6 +2582,26 @@ public class ArrayTest
}
}
[Test]
public void TestSortComparableMixed()
{
var m = new TestSortComparableMixed_Comparer ();
var arr = new object [] { 1, 2, m, 4, 5, 6, 7, 8, 9, 10 };
Array.Sort (arr);
var expected = new object [] { m, 1, 2, 4, 5, 6, 7, 8, 9, 10 };
Assert.AreEqual (expected, arr);
}
class TestSortComparableMixed_Comparer : IComparable
{
public int CompareTo (object other)
{
return -1;
}
}
[Test]
public void TestInitializeEmpty()
{