How do I test a method that returns void? For example a method like this. public void Process(int leadId) { decimal price = _calculator.CalculateNormalLead(leadId); Lead lead = new Lead(leadId, price); _leadRepository.Save(lead); } How to test what the...
There are probably uncountable amount of articles, posts and arguments on to why Unit Testing is so valuable. I just found a nice example that would’ve (or at least should’ve) been caught using Unit Tests. The following code was a bit adjusted to the...
There’s a lot of discussion going on about designing for testability. One of the problems of unit testing your code is that you might want to insert a fake object (like a stub or mock ) so that your code under test won’t actually call out to the database...