This week we are in Boston for the SPTechCon conference. Yesterday I presented 3 sessions and did a demo for Steve during his keynote presentation. Today Andrew Connell and Scott Hillier are here doing some great SharePoint sessions as well. I have posted…(read more)
Author: Tobias Zimmergren http://www.zimmergren.net | http://www.tozit.com | @zimmergren
Normally I don’t make link-posts like this one, but it is too good to miss out on. My main man and friend Andrew Connell (AC) have created a new utility for SharePoint 2010 which is essentially … (More)
This whole article is based on Andrew’s session and I really would recommend to any serious development team to get Andrew in to do some upfront consulting and potentially training. Upfront costs and his experience would definately be quickly recovered. If you have already decided to use a TDD get Andrew in to get you dev team up to a good standard with TDD for SharePoint, anyway enough of my sycophantic
- Visual Studio (VS) 2010 any edition;
- NUnit - preferable to MSTest for SharePoint dev
- TestDriven.Net (optional)
- ReSharper (optional)
Part 1 focuses on using setting up a basic “Magic 8 Ball” to unit test the business logic using nUnit.
Tip: using coding Katas (really good approach to training, this is the 1st time I’ve used them and they actually really work) to get a full unit testing system working.
Tip: Write the unit test and then write the code to fix the test.
At the SharePoint retreat, each session started with a:
- Review of the last sessions code (if appicable),
- Followed by an overview of what will be the next bit of coding logic (instructor lead teaching/demo exercise),
- Break into a new pair programming team to code (old code is throw away and a fresh set of code is started that includes all the exercise from all the previous sessions), and
- Loop – Back to step 1 (Review each pairs code).
6. Add this basic code snippet to your Visual Studio code snippets (Resharper has better code snippet support). 7. Write you 1st unit test (the simpler the better) as show below:
8. Build your project to ensure it compiles. 9. Comptete the test code as shown below and run the test.
Tip: Strictly following TDD principals your test should fail and then you write code to fix it in the BOL code.
Andrew Woodward’s codeplex project on the magic 8 Ball which provides the code you can use to build the magic 8 Ball with TDD.
Here is a slide deck to a presentation on the Magic 8 Ball TDD project.
Part 2 of the series looks at testing SharePoint using Type Moch Isolator.
Andrew gave a clear example that we worked on throughout the day, enjoyed the unit testing with nUnit. I’m not totally sold on the TypeMoch as I feel like I’m testing the SharePoint API but it does increase code coverage.
Paul Hunt (@cimares) has done 3 great posts on the SPRetreat event. Paul has transcribed the sessions extremely well and with good examples delivered in a step by step approach.
I have problems while uninstalling McAfee security for MOSS-2007. Please help.
press start-control panel- programs-uninstall a program
and look for McAfee Security for Microsoft SharePoint 2007 and click and uninstall it
on: 31st August 10