Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good resources about unit testing? [closed]

Is there any good book or material which covers C# unit testing using mocks in depth?

like image 378
user11039 Avatar asked Oct 14 '08 12:10

user11039


People also ask

How to do unit testing properly?

While performing unit testing, make sure that all the unit tests are independent. If having any dependencies, then unit tests can get affected when there are any changes or enhancements. Also, it can result in complexities for the test cases to run and debug. Hence, always make sure that unit test cases are independent. 2.

What are the advantages of unit testing?

A well-constructed unit test can be used as documentation, which is updated each time the test is run. Because each unit test is a standalone function, it can test different parts of a project without waiting for others to be completed.

What is the use of unit test framework?

– While executing the test cases, the unit test frameworks help to flag and report the failed test cases. Also, based on the failures in the test cases, the unit test frameworks help to stop the related testing. What are Unit Testing best practices? 1. Ensure Unit Tests are independent of each other:

What makes a good unit test case?

A unit test case works with something specific about a functionality, it doesn't cover it entirely. It's a bad practice to create something called testAllThings and call every method in the namespace. Another important aspect of a unit test is that it works with the use case in isolation.


3 Answers

How about The Art of Unit Testing. This is .NET specific, and should be fairly up to date.

like image 54
Marc Gravell Avatar answered Sep 30 '22 20:09

Marc Gravell


There is a rather good book describing how to use NUnit and NMock to do C# unit testing:

Pragmatic Unit Testing in C#

like image 34
Jonas Pegerfalk Avatar answered Sep 30 '22 19:09

Jonas Pegerfalk


There are lots of documents on the nmock web site:

http://www.nmock.org/tutorial.html http://www.nmock.org/advanced.html

like image 35
Scott James Avatar answered Sep 30 '22 19:09

Scott James