}
}
+
+ [Test]
+ // From bug #80563
+ public void ICollectionNull ()
+ {
+ ICollection<object> test;
+
+ test = new List<object>();
+ AssertEquals ("list<o>", test.Contains (null), false);
+
+ test = new object[] {};
+ AssertEquals ("empty array", test.Contains (null), false);
+
+ test = new object[] {null};
+ AssertEquals ("array with null", test.Contains (null), true);
+
+ test = new List<object>(test);
+ AssertEquals ("List<object> with test", test.Contains (null), true);
+
+ test = new object[] {new object()};
+ AssertEquals ("array with object", test.Contains (null), false);
+
+ test = new List<object>(test);
+ AssertEquals ("array with test", test.Contains (null), false);
+ }
#endif
+
+ #region Bug 80299
+
+ enum ByteEnum : byte {}
+ enum IntEnum : int {}
+
+ [Test]
+ public void TestByteEnumArrayToByteArray ()
+ {
+ ByteEnum[] a = new ByteEnum[] {(ByteEnum) 1, (ByteEnum) 2};
+ byte[] b = new byte[a.Length];
+ a.CopyTo (b, 0);
+ }
+
+ [Test]
+ public void TestByteEnumArrayToIntArray ()
+ {
+ ByteEnum[] a = new ByteEnum[] {(ByteEnum) 1, (ByteEnum) 2};
+ int[] b = new int[a.Length];
+ a.CopyTo (b, 0);
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArrayTypeMismatchException))]
+ public void TestIntEnumArrayToByteArray ()
+ {
+ IntEnum[] a = new IntEnum[] {(IntEnum) 1, (IntEnum) 2};
+ byte[] b = new byte[a.Length];
+ a.CopyTo (b, 0);
+ }
+
+ [Test]
+ public void TestIntEnumArrayToIntArray ()
+ {
+ IntEnum[] a = new IntEnum[] {(IntEnum) 1, (IntEnum) 2};
+ int[] b = new int[a.Length];
+ a.CopyTo (b, 0);
+ }
+
+ #endregion
}
}