public void Intersection() { Assert.IsTrue(exceptionFilter.Matches(typeof(SystemException))); Assert.IsTrue(hasRootCauseFilter.Matches(typeof(StackOverflowException))); ITypeFilter intersection = TypeFilters.Intersection(exceptionFilter, hasRootCauseFilter); Assert.IsFalse(intersection.Matches(typeof(SystemException))); Assert.IsFalse(intersection.Matches(typeof(TestObject))); Assert.IsTrue(intersection.Matches(typeof(StackOverflowException))); }
public void Union() { Assert.IsTrue(exceptionFilter.Matches(typeof(SystemException))); Assert.IsFalse(exceptionFilter.Matches(typeof(TestObject))); Assert.IsFalse(itoFilter.Matches(typeof(Exception))); Assert.IsTrue(itoFilter.Matches(typeof(TestObject))); ITypeFilter union = TypeFilters.Union(exceptionFilter, itoFilter); Assert.IsTrue(union.Matches(typeof(SystemException))); Assert.IsTrue(union.Matches(typeof(TestObject))); }
/// <summary> /// Changes current pointcut to intersection of the current and supplied pointcut /// </summary> /// <param name="other">pointcut to diff against</param> /// <returns>updated pointcut</returns> public virtual ComposablePointcut Intersection(IPointcut other) { _typeFilter = TypeFilters.Intersection(_typeFilter, other.TypeFilter); _methodMatcher = MethodMatchers.Intersection(_methodMatcher, other.MethodMatcher); return(this); }
/// <summary> /// Changes the current type filter to be the intersection of the existing filter /// and the supplied <paramref name="filter"/>. /// </summary> /// <param name="filter">The filter to diff against.</param> /// <returns> /// The intersection of the existing filter and the supplied <paramref name="filter"/>. /// </returns> public virtual ComposablePointcut Intersection(ITypeFilter filter) { _typeFilter = TypeFilters.Intersection(_typeFilter, filter); return(this); }