Squeak Class Documentation category index | class index  
 
TestCase
  category: SUnit-Core
  superclass: Object
  subclasses: TestIndenting TestParagraphFix CelesteTestCase ExampleSetTest SUnitTest TimeTestCase TestViaMethodCall

Defines the fixture to run multiple tests plus the tests using this fixture. To define a test case

* implement a subclass of TestCase,
* define instance variables that store the state of the fixture,
* initialize the fixture state by overriding TestCase setUp,
* clean-up after a test by overriding TestCase tearDown, and

Each test runs in its own fixture so there can be no side effects among test runs.

For each test in the context of this fixture set-up,

* implement a method(s) which interacts with the fixture.

In the test method(s) verify the expected results with assertions specified by calling

* TestCase assert:
* TestCase deny:
* TestCase should:
* TestCase shouldnt:
* TestCase value:shouldRaise: or
* TestCase value:shouldntRaise:

with arguments of the expected type.

Instance Variables:
testMessage <Symbol>

instance methods
  Accessing
  assert:
deny:
resources
selector
should:
should:raise:
shouldnt:
shouldnt:raise:
signalFailure:

  Dependencies
  addDependentToHierachy:
removeDependentFromHierachy:

  Printing
  printOn:

  Private
  executeShould:inScopeOf:
performTest
setTestSelector:

  Running
  debug
debugAsFailure
debugUsing:
openDebuggerOnFailingTestMethod
run
run:
runCase
runCaseAsFailure
setUp
tearDown

  Testing
  areAllResourcesAvailable

  asserting
 

  printing
 

  private accessing
 

  running
 

class methods
  Accessing
  allTestSelectors
resources
testSelectors

  Building Suites
  buildSuite
buildSuiteFromAllSelectors
buildSuiteFromLocalSelectors
buildSuiteFromMethods:
buildSuiteFromSelectors

  Instance Creation
  debug:
run:
selector:
suite

  Testing
  isAbstract
shouldInheritSelectors

  instance creation
 

  processing
 

instance methods
  Accessing top  
 

assert:

Throw an assertion error if aBlock does not evaluates to true.


 

deny:


 

resources


 

selector


 

should:


 

should:raise:


 

shouldnt:


 

shouldnt:raise:


 

signalFailure:


  Dependencies top  
 

addDependentToHierachy:

an empty method. for Composite compability with TestSuite


 

removeDependentFromHierachy:

an empty method. for Composite compability with TestSuite


  Printing top  
 

printOn:

Append to the argument, aStream, a sequence of characters that
identifies the receiver.


  Private top  
 

executeShould:inScopeOf:


 

performTest


 

setTestSelector:


  Running top  
 

debug


 

debugAsFailure


 

debugUsing:


 

openDebuggerOnFailingTestMethod

SUnit has halted one step in front of the failing test method. Step over the 'self halt' and
send into 'self perform: testSelector' to see the failure from the beginning


 

run


 

run:


 

runCase


 

runCaseAsFailure


 

setUp


 

tearDown


  Testing top  
 

areAllResourcesAvailable


  asserting top  

  printing top  

  private accessing top  

  running top  

class methods
  Accessing top  
 

allTestSelectors


 

resources


 

testSelectors


  Building Suites top  
 

buildSuite


 

buildSuiteFromAllSelectors


 

buildSuiteFromLocalSelectors


 

buildSuiteFromMethods:


 

buildSuiteFromSelectors


  Instance Creation top  
 

debug:


 

run:


 

selector:


 

suite


  Testing top  
 

isAbstract

Override to true if a TestCase subclass is Abstract and should not have
TestCase instances built from it


 

shouldInheritSelectors

answer true to inherit selectors from superclasses


  instance creation top  

  processing top