Esempio n. 1
0
 public void BadModelPathReturnsNullJournal()
 {
     var runner = new TestRunner(TestSetupData());
     var testData = runner.Assemblies.SelectMany(a=>a.Fixtures).SelectMany(f => f.Tests).First(t => t.Name == "TestE");
     runner.SetupTests();
     Assert.IsNull(testData.JournalPath);
 }
Esempio n. 2
0
 public void DoesNotRunCategoryThatIsExcluded()
 {
     var setupData = new RunnerSetupData
     {
         WorkingDirectory = workingDir,
         DryRun = true,
         Results = Path.GetTempFileName(),
         Continuous = false,
         IsTesting = true,
         ExcludedCategory = "Failure"
     };
     var runner = new TestRunner(setupData);
     runner.SetupTests();
     Assert.AreEqual(runner.GetRunnableTests().Count(), 3);
 }
Esempio n. 3
0
        public void RunByCategorySetup_Integration()
        {
            var runner = new TestRunner(TestSetupData());
            var assData = runner.Assemblies.First();
            assData.ShouldRun = false;

            var catData = runner.Assemblies.SelectMany(a => a.Categories).First(c => c.Name == "Integration");
            ((IExcludable)catData).ShouldRun = true;

            Assert.AreEqual(runner.GetRunnableTests().Count(), catData.Tests.Count);
        }
Esempio n. 4
0
 public void RunByAssemblySetup()
 {
     var runner = new TestRunner(TestSetupData());
     runner.SetupTests();
     Assert.AreEqual(runner.GetRunnableTests().Count(), 5);
 }
Esempio n. 5
0
        public void RunTwoSelectedCategories()
        {
            var setupData = new RunnerSetupData
            {
                WorkingDirectory = workingDir,
                DryRun = true,
                Results = Path.GetTempFileName(),
                Continuous = false,
                IsTesting = true,
            };
            var runner = new TestRunner(setupData);
            var assData = runner.Assemblies.First();
            assData.ShouldRun = false;

            var catData1 = runner.Assemblies.SelectMany(a => a.Categories).First(c => c.Name == "Smoke");
            ((IExcludable)catData1).ShouldRun = true;

            var catData2 = runner.Assemblies.SelectMany(a => a.Categories).First(c => c.Name == "Integration");
            ((IExcludable)catData2).ShouldRun = true;

            runner.SetupTests();
            Assert.AreEqual(runner.GetRunnableTests().Count(), 3);
        }
Esempio n. 6
0
 public void RunsTestIfSpecifiedInParameters()
 {
     var setupData = new RunnerSetupData
     {
         WorkingDirectory = workingDir,
         DryRun = true,
         Results = Path.GetTempFileName(),
         Continuous = false,
         IsTesting = true,
         Test = "TestA"
     };
     var runner = new TestRunner(setupData);
     runner.SetupTests();
     Assert.AreEqual(runner.GetRunnableTests().Count(), 1);
 }
Esempio n. 7
0
        public void RunByTestSetup()
        {
            var runner = new TestRunner(TestSetupData());
            var assData = runner.Assemblies.First();
            assData.ShouldRun = false;

            var testData = assData.Fixtures.First().Tests.First();
            testData.ShouldRun = true;
            runner.SetupTests();
            Assert.AreEqual(runner.GetRunnableTests().Count(), 1);
        }
Esempio n. 8
0
        public void RunByFixtureSetup_FixtureB()
        {
            var runner = new TestRunner(TestSetupData());
            var assData = runner.Assemblies.First();
            assData.ShouldRun = false;

            var fixData = assData.Fixtures.First(c => c.Name == "FixtureB");
            ((IExcludable)fixData).ShouldRun = true;

            Assert.AreEqual(runner.GetRunnableTests().Count(), fixData.Tests.Count);
        }