linux-packaging-mono/mcs/tests/gtest-autoproperty-01.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

38 lines
467 B
C#

// Tests automatic properties
using System;
public class Test
{
private class A
{
public string B { get; set; }
}
public string Foo { get; set; }
public int Answer { get; private set; }
public Test ()
{
Answer = 42;
}
public static int Main ()
{
Test t = new Test ();
t.Foo = "Bar";
if (t.Foo != "Bar")
return 1;
if (t.Answer != 42)
return 2;
A a = new A ();
a.B = "C";
if (a.B != "C")
return 3;
return 0;
}
}