Contents tagged with Unit Testing
-
Setting Up MVC Using StructureMap, Moq and NUnit...Quickly
When I was first attracted to the Microsoft MVC Framework, one of my main ambitions was to develop using a more test driven approach. There are ways to include Unit testing with WebForms, but the friction was just too much to justify on the web projects I was involved with.
-
Unit Testing Videos
The Learn Visual Studio.net website has just published a new series on unit testing, covering an introduction to unit testing, using MSTest, and NUnit. These are always good sources of practical information to help you get up to speed on anything .net. Go check them out.
-
Do you test your private methods?
There is ample discussion on the blogosphere as to why you should or shouldn't test your private methods.
-
Objectives 2009
I am a little late in setting out my resolutions, and although 1st January is a good time of year to set out your objectives, I’ve never liked to be restricted by a date. If I smoked (which I don’t), and I wanted to give it up, I wouldn’t wait until the 1st Jan, I would give up there and then. No time like the present. So last February I set out some objectives for the coming 6 months, how did I do?
-
My end of year tool honours list
Well the holiday season is finally upon us, and I would like to take this opportunity to post a list of applications that I personally have found useful over the past 12 months. There are some classics in there, but a few surprises. Have a look, there may be something of interest to you. So, have yourself a ‘Merry Christmas and a Happy New Year’.
-
Integrate NCover with CC.Net
In previous posts I have covered getting cc.net up and running, combining NUnit reports with cc.net and generating documentation automatically as part of the build process. In this post I want to briefly describe how to get your unit test code coverage integrated with cc.net.
-
How do you test private methods?
This morning I read a post by Davy Brion who was explaining a technique to test private methods. Although the post was interesting, it was a comment by Rafferty Uy that got me thinking. He suggests that you make your method protected instead of private and have the testing class inherit from this class. There is much debate as to whether you should be testing private methods at all, and as I am fairly new to unit testing, I have only ever tested my public methods.
-
Being saved by...unit tests
The time comes in every developers life when a higher up requests what they think is a minor change. You think about it and agree also thinking that it would not take too much time. It is only when you get back to your desk, check out the code and look to where the change is going to happen when you realise the worst. If you make a change here what repercussions will you introduce, is it possible you could introduce a defect in the code which could then go on to really crap up the application. This happened to me last week, luckily I already had some unit tests in place covering the code which was in need of changing. I knew what the method in question was going to return, and so did the unit tests. I made the necessary changes and re-run the tests. Fantastic they all pass. The code checked in, the tests passed again and the nightly build was successful. The moral to this little tale? Introduce unit tests as soon as you can to test your code. As Ian Cooper points out:-
-
My notes on becoming a better developer
Following on from Justin Etheredge post about becoming a better developer, I would just like to add my nuggets of info.
-
Retrofitting Unit Tests
This is a post that I had written a while back and never committed to it, I think it's because the title has the potential to kick up a storm. Well I have been reading the new http://stackoverflow.com web site for the past couple of hours (I know I should be doing some real work, but I would put it down to research). What a brilliant site, well done guys. Anyway the census I have come to is that re unit tests: