public void FullMethodName() { ApplyBehavior().ToMethodsMatching( @"NailsFramework\.Tests\.IoC\.Aspects\.AspectConditionsTests\.TestClass\.TestMethod*"); aspect = Nails.Configuration.Aspects.Single(); Assert.IsTrue(aspect.AppliesTo(typeof (TestClass).GetMethod("TestMethod"))); }
public void ShouldIgnoreExcludedMethods() { Assert.IsTrue(aspect.AppliesTo(typeof(TestClass).GetMethod("TestMethod"))); }
public void NotMatching() { ApplyBehavior().ToMethodsMatching("lalala"); aspect = Nails.Configuration.Aspects.Single(); Assert.IsFalse(aspect.AppliesTo(typeof (ITestInterface).GetMethod("TestMethod"))); }
public void Namespace() { ApplyBehavior().ToMethodsMatching(@".*Tests\.IoC\.Aspects*"); aspect = Nails.Configuration.Aspects.Single(); Assert.IsTrue(aspect.AppliesTo(typeof (TestSubClass).GetMethod("TestMethod"))); }
public override bool Matches(MethodInfo method, Type targetType) { return(Aspect.AppliesTo(method)); }
public void Inheritor() { Assert.IsFalse(aspect.AppliesTo(typeof(TestSubClass).GetMethods().First())); }
public void Inheritor() { Assert.IsTrue(aspect.AppliesTo(typeof(GenericTestSubClass <int>).GetMethods().First())); }