lucee.Componenttestbox.system.BaseSpec
testbox.system.compat.framework.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. |
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. |
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
|
expectException([any expectedExceptionType], [any expectedExceptionMessage='.*'])
Expect an exception from the testing spec. |
any
|
fail([any message=''])
Fail assertion. |
any
|
getMockFactory()
|
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()
|
Methods inherited from class lucee.Component |
---|
None |
Constructor Detail |
---|
LIFE-CYCLE Methods **********************************
Method Detail |
---|
Utility for dynamically adding assertion behaviors at runtime
decoratorName
- The fully qualied name of the assertion component to add; e.g., org.mycompany.MyAssertionComponentAssert that the passed expression is true
assert
in class
BaseSpec
condition
message
Compares two arrays, element by element, and fails if differences exist
expected
actual
message
Core assertion that compares the values the EXPECTED and ACTUAL parameters
expected
actual
message
Core assertion that compares the values the EXPECTED and ACTUAL parameters with case-sensitivity
expected
actual
message
Assert that the passed in actual number or date is expected to be close to it within +/- a passed delta and optional datepart
expected
actual
tolerance
datePart
message
Assert something is false
condition
message
Assert something is array
a
message
Assert something is defined or not
o
message
Assert string is empty
o
message
Assert array is empty
a
message
Assert query is empty
q
message
Assert struct is empty
struct
message
Assert something is of a certrain object type without any inheritance lookup
o
type
message
Assert something is query
q
message
Assert something is struct
actual
message
Assert something is of a certrain object type
actual
typeName
message
Assert something is an XMLDoc
xml
message
Core assertion that compares the values the EXPECTED and ACTUAL parameters to NOT be equal
expected
actual
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.
expected
actual
message
Compares 2 queries, cell by cell, and fails if differences exist
expected
actual
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.
expected
actual
message
Compares two structures, key by key, and fails if differences exist
expected
actual
message
Assert something is true
condition
message
MXUnit style debug
debug
in class
BaseSpec
var
- The variable to debuglabel
- The label to add to the debug entryExpect an exception from the testing spec
expectedExceptionType
- the type to expectexpectedExceptionMessage
- Optional exception messageFail assertion
fail
in class
BaseSpec
message
- The message to fail withinjects the method from giver into receiver. This is helpful for quick and dirty mocking
receiver
giver
functionName
functionNameInReceiver
Injects properties into the receiving object
receiver
propertyName
propertyValue
scope
mocked
Run a test remotely like MXUnit
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 with