# Yahoo! UI Library

### yuitest 2.7.0

Yahoo! UI Library > yuitest > YAHOO.tool.TestCase
Search:
Filters Show Private Show Protected Show Deprecated

## Class YAHOO.tool.TestCase

Test case containing various tests to run.

### Constructor

YAHOO.tool.TestCase `( template )`

Parameters:
  `template <object>` An object containing any number of test methods, other methods, an optional name, and anything else the test case needs.

### Methods

#### resume

`Void resume ( segment )`
Resumes a paused test and runs the given function.

Parameters:
  `segment <Function>` (Optional) The function to run. If omitted, the test automatically passes.

Returns: `Void`

#### setUp

`Void setUp ( )`
Function to run before each test is executed.

Returns: `Void`

#### tearDown

`Void tearDown ( )`
Function to run after each test is executed.

Returns: `Void`

#### wait

`Void wait ( segment , delay )`
Causes the test case to wait a specified amount of time and then continue executing the given code.

Parameters:
  `segment <Function>` (Optional) The function to run after the delay. If omitted, the TestRunner will wait until resume() is called.
  `delay <int>` (Optional) The number of milliseconds to wait before running the function. If omitted, defaults to zero.

Returns: `Void`

Copyright © 2009 Yahoo! Inc. All rights reserved.