[System.Net.Http] HttpClient timeout range checks. Fixes #25755
[mono.git] / mcs / tests / test-anon-172.cs
1 using System;
2 using System.Reflection.Emit;
3 using System.Reflection;
4
5 class MainClass
6 {
7         public static int Main ()
8         {
9                 var dynMethod = new DynamicMethod ("Metoda", MethodAttributes.Public | MethodAttributes.Static, CallingConventions.Standard,
10                                         null, Type.EmptyTypes, typeof (MainClass), true);
11                 var generator = dynMethod.GetILGenerator ();
12
13                 generator.Emit (OpCodes.Ldc_I4_7);
14                 GenerateCodeCall (generator, (int a) => {
15                         Console.WriteLine (a);
16                 });
17
18                 generator.Emit (OpCodes.Ret);
19
20                 var deleg = (Action)dynMethod.CreateDelegate (typeof (Action));
21                 deleg ();
22                 return 0;
23         }
24
25         static void GenerateCodeCall<T1> (ILGenerator generator, Action<T1> a)
26         {
27                 generator.Emit (OpCodes.Call, a.Method);
28         }
29 }
30