How to start unit-test old and new code?

前端 未结 5 1990
谎友^
谎友^ 2021-02-05 09:43

I admit that I have almost none experience of unittesting. I did a try with DUnit a while ago but gave up because there was so many dependencies between classes in my applicatio

5条回答
  •  悲哀的现实
    2021-02-05 10:10

    For .Net unittesting read this : "The Art of Unit Testing: with Examples in .NET"

    About best pratices :
    What you said is right : Sometimes, it's difficult to write unit tests because of the dependancy between classes... So write unit tests just after or just before ;-) the implementation of the classes. Like this, if you have some difficulties to write the tests, maybe it means you have a design problem !

提交回复
热议问题