Is it bad practice to run tests on a database instead of on fake repositories?

前端 未结 11 1355
傲寒
傲寒 2020-12-10 04:01

I know what the advantages are and I use fake data when I am working with more complex systems.

What if I am developing something simple and I can easily set up my e

11条回答
  •  生来不讨喜
    2020-12-10 04:40

    If you're just writing a simple one-off application that you absolutely know will not grow, I think a lot of "best practices" just go right out the window.

    You don't need to use DI/IOC or have unit tests or mock out your db access if all you're writing is a simple "Contact Us" form. However, where to draw the line between a "simple" app and a "complex" one is difficult.

    In other words, use your best judgment as there is no hard-and-set answer to this.

提交回复
热议问题