Debian Codegraph @

mcs/tests/gtest-autoproperty-11.cs

raw symbols SCIP
1 using System;
2 using System.Reflection;
3
4 public class Test
5 {
6 public string Property1 { get; }
7
8 public int Property2 { get; }
9
10 public static int Main ()
11 {
12 var t = new Test ();
13 if (t.Property1 != null)
14 return 1;
15
16 if (t.Property2 != 0)
17 return 2;
18
19 var fields = typeof (Test).GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
20 if (fields.Length != 2)
21 return 3;
22
23 foreach (var fi in fields) {
24 if ((fi.Attributes & FieldAttributes.InitOnly) == 0)
25 return 4;
26 }
27
28 return 0;
29 }
30 }