public void With_Type_Interceptor_Test() { var Configure = new AspectConfigure(); var matcher = new InterceptorMatcher(Configure); var method = ReflectionExtensions.GetMethod <Action <WithInterceptorMatcherModel> >(m => m.WithOutInterceptor()); var interceptors = matcher.Select(method, typeof(WithInterceptorMatcherModel).GetTypeInfo()); Assert.NotEmpty(interceptors); Assert.Single(interceptors); }
public void WithOutInterceptor_Test() { var Configure = new AspectConfigure(); var matcher = new InterceptorMatcher(Configure); var method = ReflectionExtensions.GetMethod <Action <InterceptorMatcherModel> >(m => m.WithOutInterceptor()); var interceptors = matcher.Select(method, method.DeclaringType.GetTypeInfo()); Assert.Empty(interceptors); }
public void With_Configure_Interceptor_Test() { var Configure = new AspectConfigure(); var ConfigureInterceptor = new InjectedInterceptor(); Configure.GetConfigureOption <IInterceptor>().Add(m => ConfigureInterceptor); var matcher = new InterceptorMatcher(Configure); var method = ReflectionExtensions.GetMethod <Action <InterceptorMatcherModel> >(m => m.ConfigureInterceptor()); var interceptors = matcher.Select(method, method.DeclaringType.GetTypeInfo()); Assert.NotEmpty(interceptors); Assert.Single(interceptors, ConfigureInterceptor); }