* Control.cs: Don't do anything in WmShowWindow if the control has been
[mono.git] / mcs / tests / gtest-autoproperty-03.cs
1 // Compiler options: -langversion:linq
2 // Make sure that the field and accessor methods of an automatic property have the CompilerGenerated attribute
3 using System;
4 using System.Reflection;
5 using System.Runtime.CompilerServices;
6
7 public class Test
8 {
9         public string Foo { get; set; }
10         
11         static int Main ()
12         {
13                 FieldInfo [] fields = typeof (Test).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
14                 if (!(fields.Length > 0))
15                         return 1;
16                 object [] field_atts = fields[0].GetCustomAttributes (false);
17                 if (!(field_atts.Length > 0))
18                         return 2;
19                 if (field_atts[0].GetType() != typeof (CompilerGeneratedAttribute))
20                         return 3;
21                 
22                 PropertyInfo property = typeof (Test).GetProperty ("Foo");
23                 MethodInfo get = property.GetGetMethod (false);
24                 object [] get_atts = get.GetCustomAttributes (false);
25                 if (!(get_atts.Length > 0))
26                         return 4;
27                 if (get_atts[0].GetType() != typeof (CompilerGeneratedAttribute))
28                         return 5;
29                         
30                 MethodInfo set = property.GetSetMethod (false);
31                 object [] set_atts = set.GetCustomAttributes (false);
32                 if (!(set_atts.Length > 0))
33                         return 6;
34                 if (set_atts[0].GetType() != typeof (CompilerGeneratedAttribute))
35                         return 7;
36
37                 return 0;
38         }
39 }