2010-04-07 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-initialize-01.cs
blobda4fc1747ab8407beab281c85e2ac10b73b2e0f3
2 // Tests object initialization
3 using System;
4 using System.Collections;
6 public class MyClass
8 public string Foo = "Bar";
9 private int answer;
10 public int Answer {
11 get { return answer; }
12 set { answer = value; }
16 public class Test
18 static int Main ()
20 MyClass mc = new MyClass() { Foo = "Baz", Answer = 42 };
21 if (mc.Foo != "Baz")
22 return 1;
23 if (mc.Answer != 42)
24 return 2;
26 return 0;