2 using System
.Collections
;
6 string[] ABC
= { "A", "B", "C" }
;
8 string [,] EFGH
= { { "E", "F" }
, { "G", "H"}}
;
10 ArrayList al
= new ArrayList ();
18 public System
.Collections
.IEnumerator
GetEnumerator()
20 foreach (string s
in ABC
){
22 throw new Exception ();
28 foreach (string s
in EFGH
){
30 throw new Exception ();
36 foreach (string s
in al
){
38 throw new Exception ();
50 public static int Main()
52 Tester tester
= new Tester();
53 string [] list
= { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L" }
;
56 foreach (string s
in tester
){
58 Console
.WriteLine ("Failure, got {0} expected {1}", s
, list
[top
]);
63 if (top
!= list
.Length
){
64 Console
.WriteLine ("Failure, expected {0} got {1}", list
.Length
, top
);
66 Console
.WriteLine ("Success");