public void SetFilters(List <XUnitFilter> newFilters) { if (newFilters == null) { _filters = null; return; } if (_filters == null) { _filters = new XUnitFiltersCollection(); } _filters.AddRange(newFilters); }
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()); }
internal void IsExcludedAsAssembly(XUnitFiltersCollection collection, TestAssemblyInfo assemblyInfo, bool excluded) { var wasExcluded = collection.IsExcluded(assemblyInfo); Assert.Equal(excluded, wasExcluded); }
internal void IsExcludedTestCase(XUnitFiltersCollection collection, ITestCase testCase, bool excluded) { var wasExcluded = collection.IsExcluded(testCase); Assert.Equal(excluded, wasExcluded); }