Life-Cycle Methods
component{
function beforeTests(){}
function afterTests(){}
function setup( currentMethod ){}
function teardown( currentMethod ){}
}component displayName="TestBox xUnit suite" labels="railo,cf"{
function setup( currentMethod ){
application.wirebox = new coldbox.system.ioc.Injector();
structClear( request );
}
function teardown( currentMethod ){
structDelete( application, "wirebox" );
structClear( request );
}
function testThrows(){
$assert.throws(function(){
var hello = application.wirebox.getInstance( "myINvalidService" ).run();
});
}
function testNotThrows(){
$assert.notThrows(function(){
var hello = application.wirebox.getInstance( "MyValidService" ).run();;
});
}
}Was this helpful?