public void TestAddWithAssemblyLoadInvalidDoesNotAddAssemblyAndReturnsNull() { NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name"); suite.IsLoadedTestNull = true; Assembly assembly = typeof(TestFixtureStubOne).Assembly; ITest test = suite.Add(assembly); Assert.IsNull(test); Assert.IsFalse(suite.ContainsAssembly(assembly)); CollectionAssert.IsEmpty(suite.TestAssemblies); }
public void TestAddWithAssemblyLoadNotRunnableDoesNotAddAssemblyAndReturnsErroneousTest() { NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name"); suite.IsLoadedTestInvalid = true; Assembly assembly = typeof(TestFixtureStubOne).Assembly; ITest test = suite.Add(assembly); Assert.IsNotNull(test); Assert.AreEqual(RunState.NotRunnable, test.RunState); Assert.IsFalse(suite.ContainsAssembly(assembly)); CollectionAssert.IsEmpty(suite.TestAssemblies); }
public void TestIsTestRunningPropertyReturnsTrueIfAnyTestIsRunning() { NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name"); suite.Add(GetType().Assembly); TestAssemblyRunnerForTest runner = new TestAssemblyRunnerForTest(); runner.IsTestRunning = true; suite.RunnerToLoad = runner; suite.Add(typeof(TestFixtureStubOne).Assembly); bool running = suite.IsTestRunning; Assert.IsTrue(running); }
public void TestIsTestCompletePropertyReturnsFalseIfNotAllTestsAreComplete() { NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name"); TestAssemblyRunnerForTest runner = new TestAssemblyRunnerForTest(); runner.IsTestComplete = true; suite.RunnerToLoad = runner; suite.Add(GetType().Assembly); runner = new TestAssemblyRunnerForTest(); runner.IsTestComplete = false; suite.RunnerToLoad = runner; suite.Add(typeof(TestFixtureStubOne).Assembly); bool completed = suite.IsTestComplete; Assert.IsFalse(completed); }
public void TestIsTestCompletePropertyReturnsTrueIfAllTestsAreComplete([Values] bool isEmpty) { NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name"); if (!isEmpty) { TestAssemblyRunnerForTest runner = new TestAssemblyRunnerForTest(); runner.IsTestComplete = true; suite.RunnerToLoad = runner; suite.Add(GetType().Assembly); runner = new TestAssemblyRunnerForTest(); runner.IsTestComplete = true; suite.RunnerToLoad = runner; suite.Add(typeof(TestFixtureStubOne).Assembly); } bool completed = suite.IsTestComplete; Assert.IsTrue(completed); }