Exemplo n.º 1
0
    public void SetFilters(List <XUnitFilter> newFilters)
    {
        if (newFilters == null)
        {
            _filters = null;
            return;
        }

        if (_filters == null)
        {
            _filters = new XUnitFiltersCollection();
        }

        _filters.AddRange(newFilters);
    }
Exemplo n.º 2
0
        public void TestCaseFilters()
        {
            var collection = new XUnitFiltersCollection();
            var assemblies = new[] { "MyFirstAssembly.dll", "SecondAssembly.dll", "ThirdAssembly.exe", };

            collection.AddRange(assemblies.Select(a => XUnitFilter.CreateAssemblyFilter(a, true)));

            var classes = new[] { "FirstClass", "SecondClass", "ThirdClass" };

            collection.AddRange(classes.Select(c => XUnitFilter.CreateClassFilter(c, true)));

            var methods = new[] { "FirstMethod", "SecondMethod" };

            collection.AddRange(methods.Select(m => XUnitFilter.CreateSingleFilter(m, true)));

            var namespaces = new[] { "Namespace" };

            collection.AddRange(namespaces.Select(n => XUnitFilter.CreateNamespaceFilter(n, true)));

            Assert.Equal(collection.Count - assemblies.Length, collection.TestCaseFilters.Count());
        }
Exemplo n.º 3
0
            internal void IsExcludedAsAssembly(XUnitFiltersCollection collection, TestAssemblyInfo assemblyInfo, bool excluded)
            {
                var wasExcluded = collection.IsExcluded(assemblyInfo);

                Assert.Equal(excluded, wasExcluded);
            }
Exemplo n.º 4
0
            internal void IsExcludedTestCase(XUnitFiltersCollection collection, ITestCase testCase, bool excluded)
            {
                var wasExcluded = collection.IsExcluded(testCase);

                Assert.Equal(excluded, wasExcluded);
            }