New test.
[mono.git] / mcs / tests / gtest-188.cs
1 using System;
2
3 public class Foo {
4
5         public static void Main ()
6         {
7                 new Foo (new object[] { "foo" });
8         }
9
10         public Foo (object[] array) : this (array, array[0]) {}
11
12         public Foo (object[] array, object context)
13         {
14                 if (array.GetType().IsArray)
15                         Console.WriteLine ("ok! array is correct type");
16                 else
17                         Console.WriteLine ("boo! array is of type {0}", array.GetType ());
18
19                 if (array[0] == context)
20                         Console.WriteLine ("ok! array[0] == context!");
21                 else
22                         Console.WriteLine ("boo! array[0] != context!");
23
24                 foreach (char ch in "123") {
25                         DoSomething += delegate (object obj, EventArgs args) {
26                                 Console.WriteLine ("{0}:{1}:{2}", ch, array[0], context);
27                         };
28                 }
29         }
30
31         public event EventHandler DoSomething;
32 }