public void Matches_MatchingMethodNameNoOverload() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Administer", "replacer"); methodOverride.IsOverloaded = false; Assert.IsTrue(methodOverride.Matches(typeof(Executor).GetMethod("Administer"))); }
public void Matches_MatchingMethodNameWithOverloadAndBadTypeIdentifiers() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer"); methodOverride.AddTypeIdentifier(GetType().FullName); Assert.IsFalse(methodOverride.Matches(typeof(Executor).GetMethod("Execute", new Type[] { typeof(object) }))); }
public void Matches_RequiresAllTypeIdentifiers() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer"); methodOverride.AddTypeIdentifier(typeof(object).FullName); Assert.IsFalse(methodOverride.Matches(typeof(Executor).GetMethod("Execute", new Type[] { typeof(object), typeof(object) }))); }
public void Matches_TotallyDifferentMethodName() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer"); Assert.IsFalse(methodOverride.Matches(typeof(Executor).GetMethod("Administer"))); }
public void MatchesWithNullMethod() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer"); Assert.Throws <ArgumentNullException>(() => methodOverride.Matches(null)); }
public void Matches_MatchingMethodNameWithOverload() { ReplacedMethodOverride methodOverride = new ReplacedMethodOverride("Execute", "replacer"); Assert.IsTrue(methodOverride.Matches(typeof(Executor).GetMethod("Execute", new Type[] {}))); }