private string Invoke(string id, string[] args)
{
try
{
StepDefinition stepDefinition = GetStepDefinition(id);
if (stepDefinition == null)
{
return FailResponse("Could not find step with id '" + id + "'");
}
if (stepDefinition.Pending)
{
return PendingResponse();
}
stepDefinition.Invoke(_objectFactory, args);
return SuccessResponse();
}
catch (TargetInvocationException x)
{
if (x.InnerException is TableAssertionException)
{
var ex = (TableAssertionException) x.InnerException;
return TableDiffResponse(ex.Expected, ex.Actual);
}
return FailResponse(x.InnerException);
}
}