コード例 #1
0
        public void Should_notify_starting_and_finishing_each_class()
        {
            var testRun = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");
            testClass1.AddPassingTest("TestMethod");
            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");
            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.OfTask(testClass1.ClassTask).AssertOrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
            testRun.Messages.OfTask(testClass2.ClassTask).AssertOrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
        }
コード例 #2
0
        public void Should_notify_starting_and_finishing_each_class()
        {
            var testRun    = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");

            testClass1.AddPassingTest("TestMethod");
            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");

            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.AssertSameTask(testClass1.ClassTask).OrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
            testRun.Messages.AssertSameTask(testClass2.ClassTask).OrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
        }
コード例 #3
0
        public void Should_continue_running_classes_after_test_class_failure()
        {
            var testRun = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");
            testClass1.AddFixture<ThrowingFixture>();
            testClass1.AddPassingTest("TestMethod");

            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");
            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.OfTask(testClass1.ClassTask).AssertOrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
            testRun.Messages.OfTask(testClass2.ClassTask).AssertOrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
        }
コード例 #4
0
        public void Should_continue_running_classes_after_failing_tests()
        {
            var testRun = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");
            testClass1.AddFailingTest("TestMethod", new EqualException(23, 186));
            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");
            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.OfTask(testClass1.ClassTask).AssertTaskStarting();
            testRun.Messages.OfTask(testClass1.ClassTask).AssertTaskFinishedWithFailingChildren();

            testRun.Messages.OfTask(testClass2.ClassTask).AssertTaskStarting();
            testRun.Messages.OfTask(testClass2.ClassTask).AssertTaskFinishedSuccessfully();
        }
コード例 #5
0
        public void Should_continue_running_classes_after_test_class_failure()
        {
            var testRun    = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");

            testClass1.AddFixture <ThrowingFixture>();
            testClass1.AddPassingTest("TestMethod");

            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");

            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.AssertSameTask(testClass1.ClassTask).OrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
            testRun.Messages.AssertSameTask(testClass2.ClassTask).OrderedActions(ServerAction.TaskStarting, ServerAction.TaskFinished);
        }
コード例 #6
0
        public void Should_continue_running_classes_after_failing_tests()
        {
            var testRun    = new TestRun();
            var testClass1 = testRun.AddClass("TestNamespace.TestClass1");

            testClass1.AddFailingTest("TestMethod", new EqualException(23, 186));
            var testClass2 = testRun.AddClass("TestNamespace.TestClass2");

            testClass2.AddPassingTest("OtherTestMethod");

            testRun.Run();

            testRun.Messages.AssertSameTask(testClass1.ClassTask).TaskStarting();
            testRun.Messages.AssertSameTask(testClass1.ClassTask).TaskFinished();

            testRun.Messages.AssertSameTask(testClass2.ClassTask).TaskStarting();
            testRun.Messages.AssertSameTask(testClass2.ClassTask).TaskFinished();
        }
コード例 #7
0
        public void Should_notify_class_start()
        {
            testRun.Run();

            testRun.Messages.OfTask(testClass.ClassTask).AssertTaskStarting();
        }
コード例 #8
0
 protected void Run()
 {
     testRun.Run(ResultInspector);
 }
        public void Should_start_class()
        {
            testRun.Run();

            testRun.Messages.AssertSameTask(testClass.ClassTask).TaskStarting();
        }