How do I unit test persistence?

后端 未结 10 1311
长发绾君心
长发绾君心 2020-12-23 16:29

As a novice in practicing test-driven development, I often end up in a quandary as to how to unit test persistence to a database.

I know that technically this would

10条回答
  •  醉话见心
    2020-12-23 16:49

    As Mike Stone said, DbUnit is great for getting the database into a known state before running your tests. When your tests are finished, DbUnit can put the database back into the state it was in before you ran the tests.

    DbUnit (Java)

    DbUnit.NET

提交回复
热议问题