阅读背景:

单元测试DAO时使用模拟对象的策略

来源:互联网 

I am curious what strategies folks have found for unit testing a data access class that does not involve loading (and presumably unloading) a real database for each test method? Are you using mock objects to represent the database connection? If so, are you required to pass the mock object into every method-under-test, and thus forcing the API to require a real db connection as a parameter to every method? Or, are you passing a mock object into the constructor at setup()?I am curious what strategies folks have found f




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: