Exemplo n.º 1
0
    private bool ApplyNamespaceFilter(ITestCase testCase, Func <bool, bool>?reportFilteredTest = null)
    {
        Func <bool, bool> log  = (result) => reportFilteredTest?.Invoke(result) ?? result;
        var testClassNamespace = testCase.GetNamespace();

        if (string.IsNullOrEmpty(testClassNamespace))
        {
            // if we exclude, since we have no namespace, we include the test
            return(log(!Exclude));
        }

        if (string.Equals(testClassNamespace, SelectorValue, StringComparison.InvariantCultureIgnoreCase))
        {
            return(log(Exclude));
        }

        // same logic as with no namespace
        return(log(!Exclude));
    }