::xounit::test
Class TestApplication

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Tested Class:
::xounit::Application

Class TestApplication
superclass ::xounit::TestCase,

Variables
NameDefault ValueClassComment
currentTestMethod    ::xounit::TestCase
 name of the currently running test method.
nodeName    ::xox::Node
 
result    ::xounit::TestCase
 the result for the current run.
 
Methods
NameComment
test {}  
testErrorApplication {}  
testFailingApplication {}  
   
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

test

Description:
 
Code:
  ::xounit::test::TestApplication instproc test {}  {
   

        set test [ ::xounit::Application new ]

        $test proc someApplication { } {

        }

        $test runApplication someApplication

        my assertEquals [ llength [ $test results ] ] 0 
    
}

testErrorApplication

Description:
 
Code:
  ::xounit::test::TestApplication instproc testErrorApplication {}  {
   

        set test [ ::xounit::Application new ]

        $test proc someApplication { } {

           error error
        }

        $test runApplication someApplication

        my assertEquals [ llength [ $test results ] ] 1 
        set result [ $test results ]
        my assertFalse [ $result passed ]
        my assertEquals [ llength [ $result results ] ] 1 
        set sub [ $result results ]
        my assertEquals [ $sub info class ] ::xounit::TestError
        my assertEquals [ lindex [ split [ $sub error ] "\n" ] 0 ] error
    
}

testFailingApplication

Description:
 
Code:
  ::xounit::test::TestApplication instproc testFailingApplication {}  {
   

        set test [ ::xounit::Application new ]

        $test proc someApplication { } {

            my fail fail
        }

        $test runApplication someApplication

        my assertEquals [ llength [ $test results ] ] 1 
        set result [ $test results ]
        my assertFalse [ $result passed ]
        my assertEquals [ llength [ $result results ] ] 1 
        set sub [ $result results ]
        my assertEquals [ $sub info class ] ::xounit::TestFailure
        my assertEquals [ $sub error ] fail
    
}