2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / mbas / Test / rerrors / Test / Array3.vb
1 ' Unhandled Exception: System.IndexOutOfRangeException: Index was outside
2 ' the bounds of the array.
3                                                                                 
4                                                                                 
5 Imports System
6 Imports Nunit.Framework
7                                                                                 
8 <TestFixture> _
9 Public Class Array3
10                                                                                 
11                 <Test, ExpectedException (GetType (System.IndexOutOfRangeException))> _
12                 Public Sub TestindexOutOfRange ()
13                         Dim arr As Integer(,) = {{1, 2, 3}, {3, 4, 7}}
14                         arr(0, 2) = arr(0, 0) * arr(0, 1)
15                         arr(1, 2) = arr(1, 0) * arr(1, 1)
16                         If arr(0, 2) <> 2 Or arr(1, 2) <> 12 Then
17                           Throw New Exception("#A1 - Array Handling Statement failed")
18                         End If
19                         ReDim Preserve arr(1, 1)
20                         arr(1, 2) = 2
21             End Sub
22 End Class
23
24
25
26
27
28
29