2007-05-25 Jonathan Chambers <joncham@gmail.com>
[mcs.git] / tests / gtest-autoproperty-01.cs
bloba215897006bdd914548ce6e3fa6115e0b08f6eda
1 // Compiler options: -langversion:linq
2 // Tests automatic properties
3 using System;
5 public class Test
7 private class A
9 public string B { get; set; }
12 public string Foo { get; set; }
13 public int Answer { get; private set; }
15 public Test ()
17 Answer = 42;
20 static int Main ()
22 Test t = new Test ();
23 t.Foo = "Bar";
24 if (t.Foo != "Bar")
25 return 1;
27 if (t.Answer != 42)
28 return 2;
30 A a = new A ();
31 a.B = "C";
32 if (a.B != "C")
33 return 3;
35 return 0;