コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }