diff --git a/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.TestCase.cs b/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.TestCase.cs index d130b6b4f6..c337d03c55 100644 --- a/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.TestCase.cs +++ b/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.TestCase.cs @@ -234,4 +234,12 @@ namespace ICSharpCode.NRefactory.TypeSystem.TestCase public static int Prop3 { get; set; } public int Prop4 { get; set; } } + + public interface IInterfaceWithProperty { + int Prop { get; set; } + } + + public class ClassWithVirtualProperty { + public virtual int Prop { get; set; } + } } diff --git a/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs b/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs index 4586652ff8..ca28a6522f 100644 --- a/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs +++ b/ICSharpCode.NRefactory.Tests/TypeSystem/TypeSystemTests.cs @@ -836,5 +836,25 @@ namespace ICSharpCode.NRefactory.TypeSystem Assert.AreEqual("add_Event3", normalEvent.AddAccessor.Name); Assert.AreEqual("remove_Event3", normalEvent.RemoveAccessor.Name); } + + [Test] + public void InterfacePropertyAccessorsShouldNotBeOverrides() { + ITypeDefinition type = GetTypeDefinition(typeof(IInterfaceWithProperty)); + var prop = type.Properties.Single(p => p.Name == "Prop"); + Assert.That(prop.Getter.IsOverride, Is.False); + Assert.That(prop.Getter.IsOverridable, Is.True); + Assert.That(prop.Setter.IsOverride, Is.False); + Assert.That(prop.Setter.IsOverridable, Is.True); + } + + [Test] + public void VirtualPropertyAccessorsShouldNotBeOverrides() { + ITypeDefinition type = GetTypeDefinition(typeof(ClassWithVirtualProperty)); + var prop = type.Properties.Single(p => p.Name == "Prop"); + Assert.That(prop.Getter.IsOverride, Is.False); + Assert.That(prop.Getter.IsOverridable, Is.True); + Assert.That(prop.Setter.IsOverride, Is.False); + Assert.That(prop.Setter.IsOverridable, Is.True); + } } }