On Jul 23, 2020, at 12:17, Garrett Fitzgerald <sarekofvul...@gmail.com> wrote:
> 
> I still have trouble conceptualizing how to write unit tests for data
> access.

That’s good, because once you exercise anything outside of the “unit”, it’s no 
longer a unit test.

What you generally do is mock the database call, returning what the DB *should* 
return. This way you’re testing your code, not the DB connection.

If you want to test against a live system, you need to run functional tests.


-- Ed Leafe







_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/e0aab4bc-bf0c-408a-bcf9-fac3f5b81...@leafe.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to