Merge pull request #1193 from esdrubal/decimal-round
[mono.git] / mcs / tests / test-expression-bodied-01.cs
1 using System;
2
3 class C
4 {
5         int value;
6         string f1 = "f-1";
7         string f2 = "f=2";
8
9         public static string Test1 (string a, string b) => a + "|" + b;
10         void Test2 (int x) => value = x;
11         Func<int> Test3 (int a) => () => a;
12
13         public static implicit operator string (C c) => "op";
14
15         protected string Prop => f1 + " " + f2;
16         static Func<string> Prop2 => () => "n1";
17
18         public int this[int arg1, int arg2] => arg2 - arg1;
19
20
21         int Check ()
22         {
23                 if (Test1 ("1", "5") != "1|5")
24                         return 1;
25
26                 Test2 (6);
27                 if (value != 6)
28                         return 2;
29
30                 if (Test3 (9) () != 9)
31                         return 3;
32
33                 string s = this;
34                 if (s != "op")
35                         return 4;
36
37                 if (Prop != "f-1 f=2")
38                         return 5;
39
40                 if (Prop2 () != "n1")
41                         return 6;
42
43                 if (this [13, 20] != 7)
44                         return 7;
45
46                 return 0;
47         }
48
49     static int Main()
50     {
51         var c = new C ();
52         return c.Check ();
53     }
54 }