public When_class_contains_ambiguously_named_test_methods()
        {
            testRun = TestRun.GetSingleClassRun();
            testClass = testRun.Classes.Single();

            testClass.AddPassingTest("TestMethod1");
            testClass.AddPassingTest("TestMethod1");
        }
 public When_fixture_throws_in_dispose()
 {
     testRun = new TestRun();
     testClass = testRun.AddClass("TestNamespace.TestClass1");
     testClass.AddFixture<ThrowsInDispose>();
     ThrowsInDispose.Exception = new InvalidOperationException("Ooops");
     testClass.AddPassingTest("TestMethod1");
     testClass.AddPassingTest("TestMethod2");
 }
        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);
        }
        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);
        }
        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();
        }
 public FakeExecutorWrapper(TestRun testRun, Func<ITestResult, ITestResult> resultInspector)
 {
     this.testRun = testRun;
     this.resultInspector = resultInspector ?? (testResult => testResult);
 }
 protected SingleClassTestRunContext()
 {
     testRun   = TestRun.GetSingleClassRun();
     testClass = testRun.Classes.Single();
 }
예제 #8
0
 public static TestRun GetSingleClassRun()
 {
     var testRun = new TestRun();
     testRun.AddClass("TestsNamespace.TestClass");
     return testRun;
 }
 protected SingleClassTestRunContext()
 {
     testRun = TestRun.GetSingleClassRun();
     testClass = testRun.Classes.Single();
 }
예제 #10
0
 public FakeExecutorWrapper(TestRun testRun, Func <ITestResult, ITestResult> resultInspector)
 {
     this.testRun         = testRun;
     this.resultInspector = resultInspector ?? (testResult => testResult);
 }