예제 #1
0
        public void TestTemplateMethod()
        // page 201
        {
            WasRun test = new WasRun("TestMethod");

            test.Run(result);
            AssertEqual("SetUp Run TearDown ", test.Log, "SetUp Run TearDown skedde inte");
            // Console.WriteLine("TestSetup har körts.");
        }
예제 #2
0
        // ----- all of the book is done. the rest is mine

        public void TestErroredResult()
        {
            WasRun test = new WasRun("ThrowingMethod");

            test.Run(result);
            AssertEqual("FAILED (runs=1, failures=0, errors=1)", result.Summary(), "Fel antal fail eller error");
            AssertEqual(1, result.RunCount, "Fel antal körda test");
            AssertEqual(0, result.FailCount, "Fel antal Fails");
            AssertEqual(1, result.ErrorCount, "Fel antal Error 87");
        }
예제 #3
0
        public void TestTestFailedResult()
        // page 107
        {
            WasRun test = new WasRun("TestBrokenMethod");

            test.Run(result);
            AssertEqual("FAILED (runs=1, failures=1, errors=0)", result.Summary(), "Fel i resultat");
            AssertEqual(1, result.RunCount, "Fel antal körda test");
            AssertEqual(1, result.FailCount, "Fel antal Fails");
            AssertEqual(0, result.ErrorCount, "Fel antal Error");
        }
예제 #4
0
        public void TestTestResult()
        // page 106
        {
            WasRun test = new WasRun("TestMethod");

            test.Run(result);
            //AssertEqual("1 run, 0 failed", result.Summary(), "Fel i resultat");
            AssertEqual(1, result.RunCount, "Fel antal körda test");
            AssertEqual(0, result.FailCount, "Fel antal Fails");
            AssertEqual(0, result.ErrorCount, "Fel antal Error");
        }