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); }
public void RunByAssemblySetup() { var runner = new TestRunner(TestSetupData()); runner.SetupTests(); Assert.AreEqual(runner.GetRunnableTests().Count(), 5); }
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); }
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); }
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); }
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); }
public void RunsFixtureIfSpecifiedInParameters() { var setupData = new RunnerSetupData { WorkingDirectory = workingDir, DryRun = true, Results = Path.GetTempFileName(), Continuous = false, IsTesting = true, Fixture = "FixtureA" }; var runner = new TestRunner(setupData); runner.SetupTests(); Assert.AreEqual(runner.GetRunnableTests().Count(), 3); }
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); }