public void mixed_and_and_or_3() { var predicate = new ChainPredicate(); predicate.Matching(filter1).Or.Matching(filter2).And.Matching(filter3); predicate.As <IChainFilter>().Matches(aChain).ShouldBeFalse(); filter1.Stub(x => x.Matches(aChain)).Return(true); predicate.As <IChainFilter>().Matches(aChain).ShouldBeTrue(); }
public void matches_with_and_negative() { var predicate = new ChainPredicate(); predicate.Matching(filter1).And.Matching(filter2); predicate.As<IChainFilter>().Matches(aChain).ShouldBeFalse(); filter1.Stub(x => x.Matches(aChain)).Return(true); predicate.As<IChainFilter>().Matches(aChain).ShouldBeFalse(); }
public void matches_with_and_negative() { var predicate = new ChainPredicate(); predicate.Matching(filter1).And.Matching(filter2); predicate.As <IChainFilter>().Matches(aChain).ShouldBeFalse(); filter1.Stub(x => x.Matches(aChain)).Return(true); predicate.As <IChainFilter>().Matches(aChain).ShouldBeFalse(); }
public void three_wide_and() { var predicate = new ChainPredicate(); predicate.Matching(filter1).And.Matching(filter2).And.Matching(filter3); filter1.Stub(x => x.Matches(aChain)).Return(true); filter2.Stub(x => x.Matches(aChain)).Return(true); predicate.As <IChainFilter>().Matches(aChain).ShouldBeFalse(); filter3.Stub(x => x.Matches(aChain)).Return(true); predicate.As <IChainFilter>().Matches(aChain).ShouldBeTrue(); }
public void does_not_pass_if_there_are_no_filters() { var predicate = new ChainPredicate(); predicate.As <IChainFilter>().Matches(new BehaviorChain()) .ShouldBeFalse(); }
bool IFormActivationFilter.ShouldActivate(BehaviorChain chain) { return filter.Matches(chain) && !_activation.As<IChainFilter>().Matches(chain); }
public void does_not_match_if_none_of_the_internal_filters_match() { thePredicate.As <IChainFilter>().Matches(aChain).ShouldBeFalse(); }
public bool ShouldBeExcluded(BehaviorChain chain) { return(_exclusions.As <IChainFilter>().Matches(chain)); }
public void mixed_and_and_ors_1() { var predicate = new ChainPredicate(); predicate.Matching(filter1).And.Matching(filter2).Or.Matching(filter3); predicate.As<IChainFilter>().Matches(aChain).ShouldBeFalse(); filter1.Stub(x => x.Matches(aChain)).Return(true); predicate.As<IChainFilter>().Matches(aChain).ShouldBeFalse(); filter2.Stub(x => x.Matches(aChain)).Return(true); predicate.As<IChainFilter>().Matches(aChain).ShouldBeTrue(); }
public void does_not_pass_if_there_are_no_filters() { var predicate = new ChainPredicate(); predicate.As<IChainFilter>().Matches(new BehaviorChain()) .ShouldBeFalse(); }