[System] Throw PlatformNotSupportedException if NetworkInformation.NetworkChange...
[mono-project.git] / mcs / tests / test-anon-123.cs
blob91c72b45afe6caf2bf71e60d1f9ab6937bc96a2b
1 // Cloning tests
3 using System;
4 using System.Collections.Generic;
6 class MemberAccessData
8 public volatile uint VolatileValue;
9 public string [] StringValues;
10 public List<string> ListValues;
12 int? mt;
13 public int? MyTypeProperty {
14 set {
15 mt = value;
17 get {
18 return mt;
23 enum E
25 E1,
26 E2,
30 public class B
32 protected virtual void BaseM ()
37 public class C : B
39 delegate void D ();
41 static void Test (D d)
45 static void Test (Action<E> func)
47 func (E.E1);
50 void InstanceTests ()
52 Test (() => base.BaseM ());
55 public static void Main ()
57 Exception diffException;
59 Test (() => {
60 diffException = null;
61 try {
62 } catch (Exception ex) {
63 diffException = ex;
64 } finally {
67 try {
68 } catch {
70 });
72 int[] i_a = new int [] { 1,2,3 };
74 Test (() => {
75 foreach (int t in i_a) {
77 });
79 Test (() => {
80 Console.WriteLine (typeof (void));
81 });
83 Test (() => {
84 Console.WriteLine (typeof (Func<,>));
85 });
87 Test (() => {
88 object o = new List<object> { "Hello", "", null, "World", 5 };
89 });
91 Test (() => {
92 var v = new MemberAccessData {
93 VolatileValue = 2, StringValues = new string [] { "sv" }, MyTypeProperty = null
95 });
97 Test (x => {
98 switch (x) {
99 case E.E1:
100 goto case E.E2;
101 case E.E2:
102 break;
103 default:
104 break;
106 });
108 var c = new C ();
109 c.InstanceTests ();