|
||||||
SUMMARY: CHILDREN | PARAMETER | INSTPROC | INSTFILTER | INSTFORWARD | DETAIL: | INSTPROC |
::xotcl::Object | +--::xox::Node | +--::xounit::Test | +--::xounit::Assert | +--::xounit::TestCase
Variables | |||
Name | Default Value | Class | Comment |
currentTestMethod |
::xounit::TestCase | name of the currently running test method. |
|
nodeName |
::xox::Node | ||
result |
::xounit::TestCase | the result for the current run. |
Methods | |
Name | Comment |
testError {}
| |
testFail {}
| |
testScope {}
| |
testSimple {}
|
Methods from ::xotcl::Object |
#, ., ?, ?code, ?methods, ?object, abstract, copy, coverageFilter, defaultmethod, extractConfigureArg, filterappend, garbageCollect, get#, getClean#, hasclass, init, methodTag, mixinappend, move, profileFilter, self, setParameterDefaults, shell, tclcmd, traceFilter,
|
Instproc Detail |
::xounit::test::TestCatchAndReport instproc testError {} { set test [ ::xounit::TestCase new ] set result [ $test newResult ] puts [ $result info class ] $test result $result $test currentTestMethod testFail $test catchAndReport { error "Passed" } puts [ $result info class ] my assertFalse [ $result passed ] my assertEquals 1 [ llength [ $result errors ] ] my assertEquals 0 [ llength [ $result failures ] ] my assertEquals 0 [ llength [ $result passes ] ] my assertEquals 1 [ llength [ $result tests ] ] }
::xounit::test::TestCatchAndReport instproc testFail {} { set test [ ::xounit::TestCase new ] set result [ $test newResult ] puts [ $result info class ] $test result $result $test currentTestMethod testFail $test catchAndReport { my fail "Passed" } puts [ $result info class ] my assertFalse [ $result passed ] my assertEquals 0 [ llength [ $result errors ] ] my assertEquals 1 [ llength [ $result failures ] ] my assertEquals 0 [ llength [ $result passes ] ] my assertEquals 1 [ llength [ $result tests ] ] my assertEquals Passed [ $result . failures . error ] }
::xounit::test::TestCatchAndReport instproc testScope {} { set a 0 my catchAndReport { set a 5 } my assertEquals 5 $a }
::xounit::test::TestCatchAndReport instproc testSimple {} { my catchAndReport { } }