public void apply_a_filter_on_fixture_graph_at_the_namespace_level() { var filter = new FixtureFilter() { Name = "ST.Grammars", Type = FilterType.Namespace }; var composite = new CompositeFilter <FixtureGraph>(); filter.Apply(composite); composite.Matches(new FixtureGraph() { FixtureNamespace = "ST.Grammars" }).ShouldBeTrue(); composite.Matches(new FixtureGraph() { FixtureNamespace = "ST.Grammars.More" }).ShouldBeTrue(); composite.Matches(new FixtureGraph() { FixtureNamespace = "More.ST.Grammars.More" }).ShouldBeFalse(); composite.Matches(new FixtureGraph() { FixtureNamespace = "SomethingDifferent" }).ShouldBeFalse(); }
public void apply_a_filter_on_fixture_graph_at_the_type_level() { var filter = new FixtureFilter { Name = typeof(MathFixture).GetFixtureAlias(), Type = FilterType.Fixture }; var composite = new CompositeFilter <FixtureGraph>(); filter.Apply(composite); composite.Matches(new FixtureGraph("Math")).ShouldBeTrue(); composite.Matches(new FixtureGraph("Math1")).ShouldBeFalse(); composite.Matches(new FixtureGraph("SomethingElse")).ShouldBeFalse(); }
public void apply_a_filter_at_the_type_level() { var filter = new FixtureFilter { Name = typeof(MathFixture).GetFixtureAlias(), Type = FilterType.Fixture }; var composite = new CompositeFilter <Type>(); filter.Apply(composite); composite.Matches(typeof(MathFixture)).ShouldBeTrue(); composite.Matches(typeof(AnotherFixture)).ShouldBeFalse(); composite.Matches(GetType()).ShouldBeFalse(); }
public void apply_a_filter_at_namespace_level() { var filter = new FixtureFilter { Name = typeof(MathFixture).Namespace, Type = FilterType.Namespace }; var composite = new CompositeFilter <Type>(); filter.Apply(composite); composite.Matches(typeof(MathFixture)).ShouldBeTrue(); typeof(AnotherFixture).IsInNamespace(typeof(MathFixture).Namespace); composite.Matches(typeof(AnotherFixture)).ShouldBeTrue(); composite.Matches(GetType()).ShouldBeFalse(); }