コード例 #1
0
        public void CountTestCases_Passes_Along_NUnitEngineException()
        {
            _driver.CountTestCases(Arg.Any <string>()).Throws(new NUnitEngineException("Message"));
            var ex = Assert.Throws <NUnitEngineException>(() => _directTestRunner.CountTestCases(_testFilter));

            Assert.That(ex.Message, Is.EqualTo("Message"));
        }
コード例 #2
0
        /// <summary>
        /// Count the test cases that would be run under
        /// the specified filter.
        /// </summary>
        /// <param name="filter">A TestFilter</param>
        /// <returns>The count of test cases</returns>
        public override int CountTestCases(TestFilter filter)
        {
            EnsurePackageIsLoaded();

            try
            {
                return(_driver.CountTestCases(filter.Text));
            }
            catch (Exception ex) when(!(ex is NUnitEngineException))
            {
                throw new NUnitEngineException("An exception occurred in the driver while counting test cases.", ex);
            }
        }
コード例 #3
0
        public void CountTestCases(string filePath)
        {
            IFrameworkDriver driver = CreateDriver(filePath);

            Assert.That(driver.CountTestCases(TestFilter.Empty.Text), Is.EqualTo(0));
        }