How to start unit testing or TDD?

后端 未结 14 1825
离开以前
离开以前 2020-12-04 07:18

I read a lot of posts that convinced me I should start writing unit test, I also started to use dependency injection (Unity) for the sake of easier mocking, but I\'m still n

14条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 07:37

    If you haven't written unit tests before, then just pick some classes and begin to write your unit tests, and continue to work on developing more unit tests.

    As you gain experience you can then begin to mock out the database for example, by using the Unity framework, but, I would suggest starting simply and gaining experience before making this leap.

    Once you are comfortable with how to write unit tests, then you can try doing TDD.

提交回复
热议问题