Setup and Teardown
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();;
});
}
}Last updated
Was this helpful?