Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-606.cs
1 using System;
2 using System.Collections;
3 using System.Reflection;
4
5 using Mono.Test;
6
7 class Program
8 {
9         public static int Main ()
10         {
11                 BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Instance |
12                         BindingFlags.DeclaredOnly;
13                 Type type = typeof (Info);
14
15                 PropertyInfo [] properties = type.GetProperties (flags);
16                 if (properties.Length != 2) {
17                         Console.WriteLine ("#1: " + properties.Length.ToString ());
18                         return 1;
19                 }
20                 if (properties [0].Name != "System.Collections.IEnumerator.Current") {
21                         Console.WriteLine ("#2: " + properties [0].Name);
22                         return 2;
23                 }
24
25                 if (properties [1].Name != "Mono.Test.ITest.Item") {
26                         Console.WriteLine ("#3: " + properties [1].Name);
27                         return 3;
28                 }
29
30                 return 0;
31         }
32 }
33
34 namespace Mono.Test
35 {
36         interface ITest
37         {
38                 object this [int index]
39                 {
40                         get;
41                         set;
42                 }
43         }
44 }
45
46 class Info : IEnumerator, ITest
47 {
48         object IEnumerator.Current
49         {
50                 get { return null; }
51         }
52
53         bool IEnumerator.MoveNext ()
54         {
55                 return false;
56         }
57
58         void IEnumerator.Reset ()
59         {
60         }
61
62         object ITest.this [int index]
63         {
64                 get { return null; }
65                 set { }
66         }
67 }