I am looking for good resources on how to write good unit test cases in C#/Dot Net. Books, resources on the net or simply good advises. In particular the unit cases should give good code coverage and cover all functionality.
|
I highly recommend the book "Pragmatic Unit Testing in C# with NUnit" by Andrew Hunt and David Thomas. If you are using Visual Studio as your IDE you might also want to check out MSDN (e.g. http://msdn.microsoft.com/en-us/library/ms182532.aspx) |
|||
|
|
|
Have you tried the book The Art of Unit Testing ? http://www.manning.com/osherove/ |
|||
|
|
|
I would suggest look into this MSDN link. But you can bing "unit test using VSTS" and you will get tons of help. |
|||
|
|
|
General Rules:
Arrange, Act, Assert: Follow the "3-As" pattern for test methods: (Arrange, Act, Assert). Specifically, use separate code paragraphs (groups of lines of code separated by a blank line) for each of the As.
This makes it much easier to see:
See the following post for more details http://tekprolixity.blogspot.com/2012/04/unit-testing-guidelines.html |
|||
|
|