Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Are you writing your own data store, or using an existing one? If you're using an existing one, assume that it already works. If you're writing your own, this works the same way as writing any other software using TDD does. Commented Mar 6, 2017 at 17:59
  • 1
    Possible duplicate of Creating Unit Tests on a CRUD layer of an Application, how can I make the tests independent? Commented Mar 6, 2017 at 18:03
  • 1
    While closely related, I do not think this is a duplicate of that particular question. The dupe target is talking about add/delete, this one is read/write. The difference is a read/write dependency likely relies on the contents of objects being read/written, while a simple add/delete test would likely be much simpler: does the object exist or not. Commented Mar 6, 2017 at 18:33
  • 2
    You can stage a database with data and no write function at all to test a read function. Commented Mar 6, 2017 at 20:40