Testing the untestable with the Adapter Design Pattern

During my session at last weeks Codegarden on ‘Getting started with Unit Testing in Umbraco’ I got a really good question in the Q&A afterwards, and I thought I would share the question and elaborate on my answer: -“What tips do you have for mocking services that are overly complex or have lots of dependencies that can't be null?”…

Showing a maintenance banner on your Umbraco site

Something we do for most of our sites is setting what we call a deploy flag during our deployments and then have our frontend render a maintenance banner at the top of the website. By showing a maintenance banner we can inform the visitor that at the moment we are performing planned maintenance and that they might experience disturbances.…

Starting to Unit Test: Not as Hard as You Think

I thought I would share a recommendation for a really great book that I think anyone who is new to Unit Testing should read: Starting to Unit Test: Not as Hard as You Think by Erik Deitrich. I read this book many years ago but I remember it to this day because it was an eye opener to what Unit Testing essentially is.…

Parallelism: NUnit vs. xUnit

Running your tests in parallel can significantly improve the speed of your test runs, but it could give you occasional problems especially if you're working on static implementations. Also turns out that depending on which testing framework you're using parallelism might be handled differently.…

How to test internal classes

When you're writing unit tests you may sometimes find yourself in a situation where you need to be able to access an internal class from within another project such as your *.Tests project.…