linux-packaging-mono/mcs/tests/gtest-autoproperty-20.cs
Xamarin Public Jenkins dd547c45d4 Imported Upstream version 4.2.1.36
Former-commit-id: fb75898888a02f4d3a74cf0a5b841681bc4c7fa8
2015-11-10 15:04:22 +00:00

46 lines
676 B
C#

using System;
namespace BrokenOverrideProperty
{
abstract class BaseClass
{
protected BaseClass (string text)
{
Whatever = text;
}
public virtual string Whatever { get; set; }
}
class DerivedClass : BaseClass
{
public string CalledValue;
public DerivedClass (string text) : base (text)
{
}
public override string Whatever {
get {
return "DerivedClass";
}
set {
CalledValue = value;
Console.WriteLine ("set called with {0}", value);
}
}
}
class MainClass
{
public static int Main ()
{
var klass = new DerivedClass ("test-value");
if (klass.CalledValue != "test-value")
return 1;
return 0;
}
}
}