コード例 #1
0
        public void ShouldFilterByNamespaceAndCategoryWhenBothArePresent()
        {
            Options.Categories = Categories;
            Options.Namespaces = Namespaces;
            var runs = new FilteredSplitExtractor(Options).Execute();

            AssertNamespaces(runs);
            AssertMethodCategories(runs);
        }
コード例 #2
0
        public void ShouldContainSubNamespaces()
        {
            Options.Namespaces = new List <string> {
                "Slowlenium"
            };
            var runs = new FilteredSplitExtractor(Options).Execute();

            Assert.AreEqual(24, runs.SelectMany(r => r.Tests).Count());
        }
コード例 #3
0
        public void ShouldIncludeTestsThatHaveACategoryOnTheFixture()
        {
            Options.Categories = new List <string> {
                "meow"
            };
            var runs = new FilteredSplitExtractor(Options).Execute();

            Assert.AreEqual(1, runs.SelectMany(r => r.Tests).Count());

            var classCategories =
                runs.SelectMany(r => r.Tests.Select(t => t.ReflectedType).Distinct())
                .SelectMany(t => t.GetCustomAttributes <CategoryAttribute>().Select(attr => attr.Name));

            Assert.IsTrue(classCategories.All(c => Options.Categories.Contains(c)));
        }