Is there a way to avoid test duplication in this case:
I have to test an async search operation based on some input. I was
wondering if is there any functionality helping me to avoid defining
the same test for various parameters. I have now
// test search by id
[Test(async, timeout="10000")]
public function queryItemsTest():void
{
createRequest(SEARCH);
var criteria:Criteria = new SearchCriteria;
criteria.id = 100264;
_chRequest.param[CRITERIA]=criteria
callRemoteAction(resultAssertHandler);
}
// test by name
[Test(async, timeout="10000")]
public function queryItemsTestName():void
{
createRequest(SEARCH);
var criteria:Criteria = new SearchCriteria;
criteria.name= "name";
_chRequest.param[CRITERIA]=criteria
callRemoteAction(resultAssertHandler);
}
Is there a way to solve that? somthing like a stub in mockolate.
Thanks