::xox::test
Class TestClassParameter

Heritage:
::xotcl::Object
  |
  +--::xox::Node
        |
        +--::xounit::Test
              |
              +--::xounit::Assert
                    |
                    +--::xounit::TestCase
Class TestClassParameter
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
testBasic {}  
testClassHierarchy {}  
testParameterValue {}  
testSubclass {}  
   
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

testBasic

Description:
 
Code:
  ::xox::test::TestClassParameter instproc testBasic {}  {
   

        my assertEquals [ ::xox::test::A exists a ] 1
        my assertEquals [ ::xox::test::A a ] 1

        set a [ ::xox::test::A new ]

        my assert [ Object isobject $a ]
        my assert [ $a hasclass ::xox::test::A ]

        my assertFalse [ $a exists a ]

        my assertEquals [ $a a ] 1

        $a a 2
        my assert [ $a exists a ]
        my assertEquals [ $a a ] 2
    
}

testClassHierarchy

Description:
 
Code:
  ::xox::test::TestClassParameter instproc testClassHierarchy {}  {
   

        my assertEquals [ ::xox::test::G exists data ] 1
        my assertEquals [ ::xox::test::G data ] "shared data"
        my assertNotEquals [ ::xox::test::H exists data ] 1


        set h [ ::xox::test::H new ]

        my assert [ Object isobject $h ]
        my assert [ $h hasclass ::xox::test::H ]

        my assertFalse [ $h exists data ]

        my assertEquals [ $h data ] "shared data"
        catch {
        $h nodata 
        } result

        my assertEquals "Could not find nodata in any of ::xox::test::H ::xox::test::G ::xotcl::Object!" $result
    
}

testParameterValue

Description:
 
Code:
  ::xox::test::TestClassParameter instproc testParameterValue {}  {
   

        my assertEquals [ ::xox::test::E exists b ] 1
        my assertEquals [ ::xox::test::E b ] 2

        set e [ ::xox::test::E new ]

        my assert [ Object isobject $e ]
        my assert [ $e hasclass ::xox::test::E ]

        my assertFalse [ $e exists b ]

        my assertEquals [ $e b ] 2

        $e b 3
        my assert [ $e exists b ]
        my assertEquals [ $e b ] 3
    
}

testSubclass

Description:
 
Code:
  ::xox::test::TestClassParameter instproc testSubclass {}  {
   

        my assertEquals [ ::xox::test::C exists b ] 1
        my assertEquals [ ::xox::test::C b ] 1

        set c [ ::xox::test::C new ]

        my assert [ Object isobject $c ]
        my assert [ $c hasclass ::xox::test::C ]

        my assertFalse [ $c exists b ]

        my assertEquals [ $c b ] 1

        $c b 2
        my assert [ $c exists b ]
        my assertEquals [ $c b ] 2
    
}