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

41 lines
573 B
C#

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