Hi,
I'm familiar with MX unit and testing individual objects, but I'm
looking at doing integration testing. I'm running the tests against
the latest version of Coldbox from SVN and MXUnit as an Eclipse
plugin.
The problem that I have is that when I run event =
execute("Account.index") the event collection doesn't seem to contain
objects.
For example to test this handler:
void function index( required event )
{
var rc = event.getCollection();
rc.validationresult =
instance.ValidationService.getValidator().newResult();
if ( structKeyExists( rc, "message") )
{
rc.validationresult.setSuccessMessage( rc.message );
}
event.setView( "account/index" );
}
this works:
function testIndex()
{
var event = "";
url.message = "hello world";
// Execute Event
event = execute("Account.index");
assertTrue( event.valueExists( "message" ) );
assertTrue( event.getValue( "message" ) eq url.message );
}
But this doesn't
function testIndex()
{
var event = "";
url.message = "hello world";
// Execute Event
event = execute("Account.index");
assertTrue( event.valueExists( "validationresult" ) ); <- fails here
}
Am I doing something wrong?
Thanks,
- John