importing messaging-2008 branch to trunk [continued]
[mono.git] / mcs / tests / gtest-407.cs
1 using System;\r
2 \r
3 struct MyColor\r
4 {\r
5         int v;\r
6 \r
7         public MyColor (int v)\r
8         {\r
9                 this.v = v;\r
10         }\r
11 \r
12         public static bool operator == (MyColor left, MyColor right)\r
13         {\r
14                 return left.v == right.v;\r
15         }\r
16 \r
17         public static bool operator != (MyColor left, MyColor right)\r
18         {\r
19                 return left.v != right.v;\r
20         }\r
21 }\r
22 \r
23 public class NullableColorTests\r
24 {\r
25         public static int Main ()\r
26         {\r
27                 MyColor? col = null;\r
28                 bool b = col == new MyColor (3);\r
29                 Console.WriteLine (b);\r
30                 if (b)\r
31                         return 1;\r
32                         \r
33                 b = col != new MyColor (3);\r
34                 if (!b)\r
35                         return 2;\r
36                 \r
37                 return 0;\r
38         }\r
39 }\r