public void TestAddTestAssemblyThrowsArgumentNullExceptionWhenAssemblyIsNull()
        {
            NUnitSuite         suite    = new NUnitSuite("suite-name");
            Assembly           assembly = null;
            NUnitRunnerForTest runner   = new NUnitRunnerForTest(suite);

            Assert.Throws(
                Is.TypeOf <ArgumentNullException>().And.Message
                .EqualTo("The assembly cannot be null. (Parameter 'assembly')"),
                // ReSharper disable once ExpressionIsAlwaysNull
                () => runner.AddTestAssembly(assembly));
        }
        public void TestAddTestAssemblyWithAssemblyLoadInvalidDoesNotAddAssemblyAndReturnsNull()
        {
            NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name");

            suite.IsLoadedTestNull = true;
            NUnitRunnerForTest runner = new NUnitRunnerForTest(suite);

            Assembly assembly = typeof(TestFixtureStubOne).Assembly;

            ITest test = runner.AddTestAssembly(assembly);

            Assert.IsNull(test);
            Assert.IsFalse(runner.TestSuite.ContainsAssembly(assembly));
            CollectionAssert.IsEmpty(runner.TestSuite.TestAssemblies);
        }
        public void TestAddTestAssemblyWithAssemblyLoadNotRunnableDoesNotAddAssemblyAndReturnsErroneousTest()
        {
            NUnitSuiteForTest suite = new NUnitSuiteForTest("suite-name");

            suite.IsLoadedTestInvalid = true;
            NUnitRunnerForTest runner = new NUnitRunnerForTest(suite);

            Assembly assembly = typeof(TestFixtureStubOne).Assembly;

            ITest test = runner.AddTestAssembly(assembly);

            Assert.IsNotNull(test);
            Assert.AreEqual(RunState.NotRunnable, test.RunState);
            Assert.IsFalse(suite.ContainsAssembly(assembly));
            CollectionAssert.IsEmpty(suite.TestAssemblies);
        }