|
TestBox 2.4.0 | ||||
FRAMES |
railo-context.Componenttestbox.system.BaseSpec
testbox.system.compat.framework.TestCase
public class TestCase
Copyright Since 2005 TestBox Framework by Luis Majano and Ortus Solutions, Corp www.ortussolutions.com --- This is the TestBox MXUnit compatible object. You can use this object as a direct replacement To MXUnit BaseTest Case. All assertions found in this object delegate to our core Assertion object.
Constructor Summary | |
---|---|
init()
LIFE-CYCLE Methods ********************************** |
Method Summary | |
---|---|
any |
addAssertDecorator(string decoratorName)
Utility for dynamically adding assertion behaviors at runtime |
any |
afterTests()
|
any |
assert(string condition, [any message=''])
Assert that the passed expression is true |
any |
assertArrayEquals(array expected, array actual, [any message=''])
Compares two arrays, element by element, and fails if differences exist |
any |
assertEquals(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters |
any |
assertEqualsCase(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters with case-sensitivity |
any |
assertEqualsWithTolerance(any expected, any actual, numeric tolerance, [any datePart=''], [any message=''])
Assert that the passed in actual number or date is expected to be close to it within +/- a passed delta and optional datepart |
any |
assertFalse(string condition, [any message=''])
Assert something is false |
any |
assertIsArray(any a, [any message=''])
Assert something is array |
any |
assertIsDefined(any o, [any message=''])
Assert something is defined or not |
any |
assertIsEmpty(any o, [any message=''])
Assert string is empty |
any |
assertIsEmptyArray(any a, [any message=''])
Assert array is empty |
any |
assertIsEmptyQuery(any q, [any message=''])
Assert query is empty |
any |
assertIsEmptyStruct(any struct, [any message=''])
Assert struct is empty |
any |
assertIsExactTypeOf(any o, any type, [any message=''])
Assert something is of a certrain object type without any inheritance lookup |
any |
assertIsQuery(any q, [any message=''])
Assert something is query |
any |
assertIsStruct(any actual, [any message=''])
Assert something is struct |
any |
assertIsTypeOf(any actual, any typeName, [any message=''])
Assert something is of a certrain object type |
any |
assertIsXMLDoc(any xml, [any message='Passed in xml is not a valid XML Object'])
Assert something is an XMLDoc |
any |
assertNotEquals(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters to NOT be equal |
any |
assertNotSame(any expected, any actual, [any message=''])
Assert that an expected and actual objec is NOT the same instance This only works on objects that are passed by reference, please remember that in Lucee arrays pass by reference and in Adobe CF they pass by value |
any |
assertQueryEquals(query expected, query actual, [any message=''])
Compares 2 queries, cell by cell, and fails if differences exist |
any |
assertSame(any expected, any actual, [any message=''])
Assert that an expected and actual objec is the same instance This only works on objects that are passed by reference, please remember that in Lucee arrays pass by reference and in Adobe CF they pass by value |
any |
assertStructEquals(struct expected, struct actual, [any message=''])
Compares two structures, key by key, and fails if differences exist |
any |
assertTrue(string condition, [any message=''])
Assert something is true |
any |
beforeTests()
|
any |
debug(any var, [string label=''])
MXUnit style debug |
any |
enableAfterTests()
|
any |
expectException([any expectedExceptionType], [any expectedExceptionMessage='.*'])
Expect an exception from the testing spec |
any |
fail([any message=''])
Fail assertion |
any |
getBaseTarget()
|
any |
getMockFactory()
|
remote any |
getRunnableMethods()
Gets an array of all runnable test methods for this test case |
any |
injectMethod(any receiver, any giver, string functionName, [string functionNameInReceiver='[runtime expression]'])
injects the method from giver into receiver |
any |
injectProperty(any receiver, string propertyName, any propertyValue, [string scope='variables'])
Injects properties into the receiving object |
any |
mock([any mocked])
|
remote any |
runTestRemote([any testMethod=''], [boolean debug='false'], [any output='simple'])
Run a test remotely like MXUnit |
any |
setMockingFramework()
|
any |
setup()
|
any |
teardown()
|
any |
TestCase()
|
Methods inherited from class railo-context.Component |
---|
|
Constructor Detail |
---|
public init()
Method Detail |
---|
public any addAssertDecorator(string decoratorName)
decoratorName
- The fully qualied name of the assertion component to add; e.g., org.mycompany.MyAssertionComponentpublic any afterTests()
public any assert(string condition, [any message=''])
assert
in class
BaseSpec
condition
message
public any assertArrayEquals(array expected, array actual, [any message=''])
expected
actual
message
public any assertEquals(any expected, any actual, [any message=''])
expected
actual
message
public any assertEqualsCase(any expected, any actual, [any message=''])
expected
actual
message
public any assertEqualsWithTolerance(any expected, any actual, numeric tolerance, [any datePart=''], [any message=''])
expected
actual
tolerance
datePart
message
public any assertFalse(string condition, [any message=''])
condition
message
public any assertIsArray(any a, [any message=''])
a
message
public any assertIsDefined(any o, [any message=''])
o
message
public any assertIsEmpty(any o, [any message=''])
o
message
public any assertIsEmptyArray(any a, [any message=''])
a
message
public any assertIsEmptyQuery(any q, [any message=''])
q
message
public any assertIsEmptyStruct(any struct, [any message=''])
struct
message
public any assertIsExactTypeOf(any o, any type, [any message=''])
o
type
message
public any assertIsQuery(any q, [any message=''])
q
message
public any assertIsStruct(any actual, [any message=''])
actual
message
public any assertIsTypeOf(any actual, any typeName, [any message=''])
actual
typeName
message
public any assertIsXMLDoc(any xml, [any message='Passed in xml is not a valid XML Object'])
xml
message
public any assertNotEquals(any expected, any actual, [any message=''])
expected
actual
message
public any assertNotSame(any expected, any actual, [any message=''])
expected
actual
message
public any assertQueryEquals(query expected, query actual, [any message=''])
expected
actual
message
public any assertSame(any expected, any actual, [any message=''])
expected
actual
message
public any assertStructEquals(struct expected, struct actual, [any message=''])
expected
actual
message
public any assertTrue(string condition, [any message=''])
condition
message
public any beforeTests()
public any debug(any var, [string label=''])
debug
in class
BaseSpec
var
- The variable to debuglabel
- The label to add to the debug entrypublic any enableAfterTests()
public any expectException([any expectedExceptionType], [any expectedExceptionMessage='.*'])
expectedExceptionType
- the type to expectexpectedExceptionMessage
- Optional exception messagepublic any fail([any message=''])
fail
in class
BaseSpec
message
- The message to fail withpublic any getBaseTarget()
public any getMockFactory()
remote any getRunnableMethods()
public any injectMethod(any receiver, any giver, string functionName, [string functionNameInReceiver='[runtime expression]'])
receiver
giver
functionName
functionNameInReceiver
public any injectProperty(any receiver, string propertyName, any propertyValue, [string scope='variables'])
receiver
propertyName
propertyValue
scope
public any mock([any mocked])
mocked
remote any runTestRemote([any testMethod=''], [boolean debug='false'], [any output='simple'])
testMethod
- A list or array of test names that are the ones that will be executed ONLY!debug
- Show debug output on the reports or notoutput
- The type of reporter to run the test withpublic any setMockingFramework()
public any setup()
public any teardown()
public any TestCase()
|
TestBox 2.4.0 | ||||
FRAMES |