ColdBox Platform v3.8.0

coldbox.system.testing.compat.framework
Class TestCase

WEB-INF.cftags.component
        extended by coldbox.system.testing.BaseSpec
            extended by coldbox.system.testing.compat.framework.TestCase
Direct Known Subclasses:
BaseTestCase

public class TestCase
extends BaseSpec

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.

Method Summary
 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 assertFalse(string condition, [any message=''])
          Assert something is false
 any assertIsArray(any actual, [any message=''])
          Assert something is array
 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 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 Railo 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 Railo 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 debug(any var)
          MXUnit style debug
 any expectException([any expectedExceptionType], [any expectedExceptionMessage='.*'])
          Expect an exception from the testing spec
 any fail([any message=''])
          Fail assertion
 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
remote any runTestRemote([any testMethod=''], [boolean debug='false'], [any output='simple'])
          Run a test remotely like MXUnit
 
Methods inherited from class coldbox.system.testing.BaseSpec
addAssertions, addMatchers, afterEach, beforeEach, clearDebugBuffer, closureStub, console, createEmptyMock, createMock, createStub, describe, expect, expectedException, getDebugBuffer, getMockBox, isExpectedException, it, makePublic, prepareMock, print, println, querySim, runRemote, runSpec, runTestMethod, xdescribe, xit
 
Methods inherited from class WEB-INF.cftags.component
None
 

Method Detail

assert

public any assert(string condition, [any message=''])
Assert that the passed expression is true

Overrides:
assert in class BaseSpec
Parameters:
condition
message

assertArrayEquals

public any assertArrayEquals(array expected, array actual, [any message=''])
Compares two arrays, element by element, and fails if differences exist

Parameters:
expected
actual
message

assertEquals

public any assertEquals(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters

Parameters:
expected
actual
message

assertEqualsCase

public any assertEqualsCase(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters with case-sensitivity

Parameters:
expected
actual
message

assertFalse

public any assertFalse(string condition, [any message=''])
Assert something is false

Parameters:
condition
message

assertIsArray

public any assertIsArray(any actual, [any message=''])
Assert something is array

Parameters:
actual
message

assertIsStruct

public any assertIsStruct(any actual, [any message=''])
Assert something is struct

Parameters:
actual
message

assertIsTypeOf

public any assertIsTypeOf(any actual, any typeName, [any message=''])
Assert something is of a certrain object type

Parameters:
actual
typeName
message

assertNotEquals

public any assertNotEquals(any expected, any actual, [any message=''])
Core assertion that compares the values the EXPECTED and ACTUAL parameters to NOT be equal

Parameters:
expected
actual
message

assertNotSame

public 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 Railo arrays pass by reference and in Adobe CF they pass by value.

Parameters:
expected
actual
message

assertQueryEquals

public any assertQueryEquals(query expected, query actual, [any message=''])
Compares 2 queries, cell by cell, and fails if differences exist

Parameters:
expected
actual
message

assertSame

public 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 Railo arrays pass by reference and in Adobe CF they pass by value.

Parameters:
expected
actual
message

assertStructEquals

public any assertStructEquals(struct expected, struct actual, [any message=''])
Compares two structures, key by key, and fails if differences exist

Parameters:
expected
actual
message

assertTrue

public any assertTrue(string condition, [any message=''])
Assert something is true

Parameters:
condition
message

debug

public any debug(any var)
MXUnit style debug

Overrides:
debug in class BaseSpec
Parameters:
var - The variable to debug

expectException

public any expectException([any expectedExceptionType], [any expectedExceptionMessage='.*'])
Expect an exception from the testing spec

Parameters:
expectedExceptionType - the type to expect
expectedExceptionMessage - Optional exception message

fail

public any fail([any message=''])
Fail assertion

Overrides:
fail in class BaseSpec
Parameters:
message - The message to fail with

injectMethod

public any injectMethod(any receiver, any giver, string functionName, [string functionNameInReceiver='[runtime expression]'])
injects the method from giver into receiver. This is helpful for quick and dirty mocking

Parameters:
receiver
giver
functionName
functionNameInReceiver

injectProperty

public any injectProperty(any receiver, string propertyName, any propertyValue, [string scope='variables'])
Injects properties into the receiving object

Parameters:
receiver
propertyName
propertyValue
scope

runTestRemote

remote any runTestRemote([any testMethod=''], [boolean debug='false'], [any output='simple'])
Run a test remotely like MXUnit

Parameters:
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 not
output - The type of reporter to run the test with

ColdBox Platform v3.8.0