More Unit Testing in Sitecore Videos


December 27, 2010 by Alistair Deneys

I’ve finally found enough free time to record the continuation of my first unit testing in Sitecore video which showed how to add a test project to your solution which used the codeflood custom NUnit test runner. The next video was a little larger than I expected and I had to split it out into 2 separate videos.

The first shows how to prepare your unit test fixture for writing tests by creating the content the test requires and then destroying that data at the end of the test. The third video shows how you can write unit tests against the known content structure and test the method I showed in the first video.

You can find all 3 videos on YouTube:

Or you can view them inline below.

Test prep

Writing unit tests


3 thoughts on “More Unit Testing in Sitecore Videos

  1. […] This post was mentioned on Twitter by Christian Hagelid. Christian Hagelid said: Unit testing in #Sitecore […]

  2. This is great stuff! We’re trying out your test runner on a project and so far it’s working well. One hurdle we came across was getting the tests to run automatically by our CI server (Hudson… or is it Jenkins now?) It turned out to be fairly trivial:

    – We extended your test runner to accept a Query parameter to indicate “auto” mode
    – We overrode the Render method to output the standard NUnit XML results file when auto mode is detected. Note, you need to reference the nunit.util.dll assembly to build the XML output
    – Hudson runs wget on the Test.aspx page post-build, and pulls down the resulting NUnit XML results
    – Hudson parses the results and reports the status

    //Code Snippet for generating NUnit XML results
    //If we’re running on auto, output the nunit xml
    if(isOnAuto && result != null)
    Response.ContentType = “text/xml”;
    NUnit.Util.XmlResultWriter outputWriter = new XmlResultWriter(writer);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


The views expressed on this blog are solely my own and do not necessarily reflect the views of my employer.
%d bloggers like this: