Mock Objects vs Test Database

后端 未结 6 1864
庸人自扰
庸人自扰 2021-02-19 20:42

What\'s the advantage of using mock objects in comparison to a static test database that has known data and using transactions to make sure nothing changes when testing against

6条回答
  •  甜味超标
    2021-02-19 20:45

    The setup for testing with a db can be arduous. If you find yourself spending more time in setting up the db, just to test some functional aspect of your business logic, then you might want to use a mock/fake.

提交回复
热议问题