Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a common problem and the reason why we have frameworks to fake objects for us. Stubs or mocks allow us to create a test harness around a class without having to instantiate lots of other classes and services. There are a number of suchh frameworks. This is a very useful blog of three common frameworks. <a href="http://www.richard-banks.org/2010/07/mocking-comparison-part-1-basics.html" rel="nofollow">http://www.richard-banks.org/2010/07/mocking-comparison-part-1-basics.html</a>. </p> <p>I am pretty new to unit testing myself and found the book The Art of Unit Testing by Roy Osherove very helpful. Roy has a blog and these are some of his posts on Unit Testing <a href="http://osherove.com/display/Search?moduleId=10002929&amp;searchQuery=Unit+Testing" rel="nofollow">http://osherove.com/display/Search?moduleId=10002929&amp;searchQuery=Unit+Testing</a></p> <p>The other thing that needs to be thought about is how closely coupled your classes are. It may not be that easy to do it but you might want to look at Dependency Injection. This allows classes to be more loosely coupled and therefore easier to test. I found the book Dependency Injection in .NET by Mark Seemann to be a good introduction.</p> <p>After my reseach I settled on <a href="http://www.nunit.org" rel="nofollow">NUnit</a> as the Test Framework, <a href="http://nsubstitute.github.com/" rel="nofollow">NSubstitute</a> for mocks and stubs, <a href="http://fluentassertions.codeplex.com/" rel="nofollow">Fluent Assertions</a> to make writing tests easier and <a href="http://www.ninject.org/" rel="nofollow">NInject</a> for Dependency Injection</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload