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")); }
/// <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); } }
public void CountTestCases(string filePath) { IFrameworkDriver driver = CreateDriver(filePath); Assert.That(driver.CountTestCases(TestFilter.Empty.Text), Is.EqualTo(0)); }