public TestFilter FilterByWhere(string where)
        {
            if (string.IsNullOrEmpty(where))
            {
                return(TestFilter.Empty);
            }
            var filterBuilder = _filterService.GetTestFilterBuilder();

            filterBuilder.SelectWhere(where);
            return(filterBuilder.GetFilter());
        }
Exemplo n.º 2
0
        private TestFilter CreateTestFilter(string[] nameFilter)
        {
            ITestFilterBuilder builder = filterService.GetTestFilterBuilder();

            foreach (var testName in nameFilter)
            {
                builder.AddTest(testName);
            }
            return(builder.GetFilter());
        }
Exemplo n.º 3
0
    static void Main(string[] args)
    {
        ITestEngine        engine         = TestEngineActivator.CreateInstance();
        ITestFilterService _filterService = engine.Services.GetService <ITestFilterService>();
        TestPackage        package        = new TestPackage(Assembly.GetExecutingAssembly().Location);

        package.AddSetting("WorkDirectory", Environment.CurrentDirectory);
        using (ITestRunner runner = engine.GetRunner(package))
        {
            ITestFilterBuilder builder = _filterService.GetTestFilterBuilder();
            XmlNode            result  = runner.Run(null, builder.GetFilter());
        }
    }
Exemplo n.º 4
0
        private TestFilter CreateTestFilter(ConsoleOptions options)
        {
            ITestFilterBuilder builder = _filterService.GetTestFilterBuilder();

            foreach (string testName in options.TestList)
            {
                builder.AddTest(testName);
            }

            if (options.WhereClauseSpecified)
            {
                builder.SelectWhere(options.WhereClause);
            }

            return(builder.GetFilter());
        }
        public TestFilter MakeTestFilter(IEnumerable <TestCase> testCases)
        {
            if (testCases.Count() == 0)
            {
                return(NoTestsFound);
            }

            ITestFilterBuilder filterBuilder = _filterService.GetTestFilterBuilder();

            foreach (TestCase testCase in testCases)
            {
                filterBuilder.AddTest(testCase.FullyQualifiedName);
            }

            return(filterBuilder.GetFilter());
        }
Exemplo n.º 6
0
        private TestFilter MakeTestFilter(IEnumerable <TestCase> testCases)
        {
            ITestFilterService filterService = TestEngine.Services.GetService <ITestFilterService>();

            if (filterService == null)
            {
                throw new NUnitEngineException("TestFilterService is not available. Engine in use is incorrect version.");
            }

            ITestFilterBuilder filterBuilder = filterService.GetTestFilterBuilder();

            foreach (TestCase testCase in testCases)
            {
                filterBuilder.AddTest(testCase.FullyQualifiedName);
            }

            return(filterBuilder.GetFilter());
        }
        private TestFilter CreateTestFilter(HostedOptions _options)
        {
            var builder = _filterService.GetTestFilterBuilder();

            return(builder.GetFilter());
        }