public void CountTestsAction_BadFile_ReturnsZero()
        {
            var driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, BAD_FILE, _settings);

            driver.Load();
            Assert.That(driver.CountTestCases(TestFilter.Empty), Is.EqualTo(0));
        }
        public void RunTestsAction_BadFile_ReturnsNonRunnableSuite()
        {
            var driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, BAD_FILE, _settings);

            driver.Load();
            var result = XmlHelper.CreateXmlNode(driver.Run(new NullListener(), TestFilter.Empty));

            Assert.That(result.Name, Is.EqualTo("test-suite"));
            Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly"));
            Assert.That(result.GetAttribute("runstate"), Is.EqualTo("NotRunnable"));
            Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo("0"));
            Assert.That(GetSkipReason(result), Contains.Substring(BAD_FILE).And.StartsWith("Could not load"));
            Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
        }
示例#3
0
        public void ExploreTestsAction_FileNotFound_ReturnsNonRunnableSuite()
        {
            var driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, MISSING_FILE, _settings);

            driver.Load();
            var result = XmlHelper.CreateXmlNode(driver.Explore(TestFilter.Empty));

            Assert.That(result.Name, Is.EqualTo("test-suite"));
            Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly"));
            Assert.That(result.GetAttribute("runstate"), Is.EqualTo("NotRunnable"));
            Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo("0"));
            Assert.That(GetSkipReason(result), Is.StringStarting("Could not load").And.Contains(MISSING_FILE));
            Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Result should not have child tests");
        }
示例#4
0
 public void CreateDriver()
 {
     _mockAssemblyPath = System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY);
     _driver           = new NUnitFrameworkDriver(AppDomain.CurrentDomain, _mockAssemblyPath, _settings);
 }
 public void CreateDriver()
 {
     _mockAssemblyPath = PathUtils.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY);
     _driver           = new NUnitFrameworkDriver(AppDomain.CurrentDomain, _mockAssemblyPath, _settings);
     _handler          = new CallbackEventHandler();
 }
 public void CreateDriver()
 {
     _mockAssemblyPath = PathUtils.Combine(TestContext.CurrentContext.TestDirectory, MOCK_ASSEMBLY);
     _driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, _mockAssemblyPath, _settings);
     _handler = new CallbackEventHandler();
 }
        public void RunTestsAction_BadFile_ReturnsNonRunnableSuite()
        {
            var driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, BAD_FILE, _settings);
            driver.Load();
            var result = XmlHelper.CreateXmlNode(driver.Run(new NullListener(), TestFilter.Empty));

            Assert.That(result.Name, Is.EqualTo("test-suite"));
            Assert.That(result.GetAttribute("type"), Is.EqualTo("Assembly"));
            Assert.That(result.GetAttribute("runstate"), Is.EqualTo("NotRunnable"));
            Assert.That(result.GetAttribute("testcasecount"), Is.EqualTo("0"));
            Assert.That(GetSkipReason(result), Contains.Substring(BAD_FILE).And.StartsWith("Could not load"));
            Assert.That(result.SelectNodes("test-suite").Count, Is.EqualTo(0), "Load result should not have child tests");
        }
 public void CountTestsAction_BadFile_ReturnsZero()
 {
     var driver = new NUnitFrameworkDriver(AppDomain.CurrentDomain, BAD_FILE, _settings);
     driver.Load();
     Assert.That(driver.CountTestCases(TestFilter.Empty), Is.EqualTo(0));
 }