summaryrefslogtreecommitdiff
path: root/mcs/class/corlib/Test/System/ArraySegmentTest.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/Test/System/ArraySegmentTest.cs')
-rw-r--r--mcs/class/corlib/Test/System/ArraySegmentTest.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/mcs/class/corlib/Test/System/ArraySegmentTest.cs b/mcs/class/corlib/Test/System/ArraySegmentTest.cs
index 6a4d8ae78f..28588f8e00 100644
--- a/mcs/class/corlib/Test/System/ArraySegmentTest.cs
+++ b/mcs/class/corlib/Test/System/ArraySegmentTest.cs
@@ -260,6 +260,24 @@ namespace MonoTests.System
s[1] = -3;
Assert.AreEqual (-3, s[1], "#2a");
}
+
+ [Test]
+ [ExpectedException (typeof (ArgumentOutOfRangeException))]
+ public void IList_IndexerErrorTest1 ()
+ {
+ byte[] arr = new byte[4];
+ IList<byte> seg = new ArraySegment<byte> (arr, 1, 2);
+ seg[-1] = 3;
+ }
+
+ [Test]
+ [ExpectedException (typeof (ArgumentOutOfRangeException))]
+ public void IList_IndexerErrorTest2 ()
+ {
+ byte[] arr = new byte[4];
+ IList<byte> seg = new ArraySegment<byte> (arr);
+ seg[4] = 3;
+ }
#endif
}
}