Exemplo n.º 1
0
 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")));
 }
Exemplo n.º 2
0
 public void ShouldIgnoreExcludedMethods()
 {
     Assert.IsTrue(aspect.AppliesTo(typeof(TestClass).GetMethod("TestMethod")));
 }
Exemplo n.º 3
0
 public void NotMatching()
 {
     ApplyBehavior().ToMethodsMatching("lalala");
     aspect = Nails.Configuration.Aspects.Single();
     Assert.IsFalse(aspect.AppliesTo(typeof (ITestInterface).GetMethod("TestMethod")));
 }
Exemplo n.º 4
0
 public void Namespace()
 {
     ApplyBehavior().ToMethodsMatching(@".*Tests\.IoC\.Aspects*");
     aspect = Nails.Configuration.Aspects.Single();
     Assert.IsTrue(aspect.AppliesTo(typeof (TestSubClass).GetMethod("TestMethod")));
 }
Exemplo n.º 5
0
 public override bool Matches(MethodInfo method, Type targetType)
 {
     return(Aspect.AppliesTo(method));
 }
Exemplo n.º 6
0
 public void Inheritor()
 {
     Assert.IsFalse(aspect.AppliesTo(typeof(TestSubClass).GetMethods().First()));
 }
Exemplo n.º 7
0
 public void Inheritor()
 {
     Assert.IsTrue(aspect.AppliesTo(typeof(GenericTestSubClass <int>).GetMethods().First()));
 }