This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using NUnit.Framework; | |
public static class MethodInfoExtensions | |
{ | |
public static bool IsOverride(this MethodInfo m) | |
{ | |
return m.GetBaseDefinition().DeclaringType != m.DeclaringType; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Reflection; | |
using NUnit.Framework; | |
public class IsOverrideTests | |
{ | |
abstract class Base | |
{ | |
public virtual void Overridden() { } | |
public virtual void Inherited() { } | |
} |