Android单元测试研究与实践(24)
} return newResponse(request.getUrl(),200, nothing ,Collections.EMPTY_LIST,newTypedByteArray( application/json ,responseString.getBytes())); } } //MockClient使用方式如下:
}
return new Response(request.getUrl(), 200, "nothing", Collections.EMPTY_LIST, new TypedByteArray("application/json",responseString.getBytes()));
}
}
//MockClient使用方式如下:
原文转自:http://tech.meituan.com/Android_unit_test.html