コード例 #1
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);
        }
コード例 #2
0
        public void RunByAssemblySetup()
        {
            var runner = new TestRunner(TestSetupData());

            runner.SetupTests();
            Assert.AreEqual(runner.GetRunnableTests().Count(), 5);
        }
コード例 #3
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);
        }
コード例 #4
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);
        }
コード例 #5
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);
        }
コード例 #6
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);
 }
コード例 #7
0
        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);
        }
コード例 #8
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);
        }
コード例 #9
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);
        }
コード例 #10
0
 public void RunByAssemblySetup()
 {
     var runner = new TestRunner(TestSetupData());
     runner.SetupTests();
     Assert.AreEqual(runner.GetRunnableTests().Count(), 5);
 }
コード例 #11
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);
        }
コード例 #12
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);
 }
コード例 #13
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);
        }
コード例 #14
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);
        }