Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / tests / test-590.cs
1 using System;
2
3 class X
4 {
5         public static int Main ()
6         {
7                 X x = new X ();
8                 return x.Do ("a", "b", "c");
9         }
10
11         string str = "start";
12
13         string Foo ()
14         {
15                 return "s";
16         }
17
18         string Prop
19         {
20                 get { return str; }
21                 set { str = value; }
22         }
23
24         string this [int i]
25         {
26                 get { return str; }
27                 set { str = value; }
28         }
29
30         int Do (string a, string b, string c)
31         {
32                 str += Foo ();
33                 if (str != "starts")
34                         return 1;
35
36                 str += a + "," + b + "," + c;
37                 if (str != "startsa,b,c")
38                         return 2;
39
40                 Prop += a;
41                 if (str != "startsa,b,ca")
42                         return 3;
43
44                 Prop += a + "," + b + "," + c;
45                 if (str != "startsa,b,caa,b,c")
46                         return 4;
47
48                 this [0] += a + "," + b + "," + c;
49                 if (str != "startsa,b,caa,b,ca,b,c")
50                         return 5;
51
52                 return 0;
53         }
54 }