do not check order sequence if option /order was not used
[mono.git] / mcs / tests / test-var-02.cs
1
2 // Tests variable type inference with the var keyword when assigning to user-defined types
3 using System;
4
5 public class Class1
6 {
7         public bool Method()
8         {
9                 return true;
10         }
11         public int Property = 16;
12 }
13
14 public class Test
15 {
16         private class Class2
17         {
18                 public bool Method()
19                 {
20                         return true;
21                 }
22                 public int Property = 42;
23         }       
24         static int Main ()
25         {
26                 var class1 = new Class1 ();
27                 
28                 if (class1.GetType () != typeof (Class1))
29                         return 1;
30                 if (!class1.Method ())
31                         return 2;
32                 if (class1.Property != 16)
33                         return 3;
34                 
35                 var class2 = new Class2();
36                 
37                 if (class2.GetType () != typeof (Class2))
38                         return 4;
39                 if (!class2.Method ())
40                         return 5;
41                 if (class2.Property != 42)
42                         return 6;
43                 
44                 return 0;
45         }
46 }