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?”…

I’m a speaker at Umbraco Codegarden 2021

This week I got some exciting news: My session on “Getting started with Unit Testing in Umbraco” has been accepted for Umbraco Codegarden 2021!…

Testing Umbraco Composers

Something I’ve been wanting to write a test for but haven't come around to yet is the Umbraco Composer that was introduced in version 8. This could look something like this.…

Unit Testing an Url Segment Provider in Umbraco

Using an IUrlSegmentProvider you can modify the url segment that Umbraco generates for any piece of content based on whatever conditions you like. This week I created a test example for this ProductPageUrlSegmentProvider and updated the GitHub project and I'll be submitting a PR to the Unit Testing documentation.…

Umbraco Leeds Meetup Summary

So yesterday was finally the day for my presentation at the Umbraco Leeds Meetup about “Getting started with Unit Testing in Umbraco”.…

Unit Testing Regular Expressions

Not only are unit tests great for securing the behaviour of your code but they also serve as form of living documentation and one area where I find this especially true is when covering regular expressions with your unit tests.…

NUnit vs. xUnit

The endless battle between the two testing frameworks NUnit and xUnit is a hot potato and in this blog post I intend to give my two cents on this topic.…

Getting started with Unit Testing #2: Don't get stuck!

A mistake you might do as a beginner tester (I probably did it myself in the beginning) is that you start of hopefully to a great start, testing is going great and you think you’ve got the hang of it…

Getting started with Unit Testing #1: Start fresh!

A lot of developers who embark on the Unit Testing journey will go: -"Okay, I'll write a test in my current project just to see how it feels!". This is almost always a bad idea and chances are you’re going to get stuck and give up. And here's why..…

Five tricks to speed up your Unit Testing today

One of the main reasons I hear for not writing tests is -"We don’t have the time!" and that it feels like it would take longer time to write code with test than without. But there are a few tricks you can apply to speed up your Unit Testing today.…

I’ll be speaking at the Umbraco Leeds Meetup

I’ll be speaking about Unit Testing and Umbraco at the Umbraco Leeds Meetup on the 6th of April. In this session I’ll be covering the basics of Unit Testing, how to get started and talk a little about my work with the official documentation and GitHub project on Unit Testing in Umbraco.…

Using Umbraco Health Checks as Integration Tests, Revisited!

Almost every one of our projects moves towards a microservice architecture and our applications are rarely these huge web apps anymore, but instead they are a bunch of applications working together in a cluster of apps.…

API Testing using Test Driven Development (TDD)

This week I’ve been working on an integration to an external provider used for newsletters subscriptions and I’ve realised that if there’s one area where TDD is a match made in heaven it’s when you're doing API Testing.…

Umbraco Unit Testing Updated: February 1, 2021

I had a little sparetime yesterday so I extended the UmbracoUnitTesting project with three additional tests examples and so I've also submitted these tests as a pull request to the Umbraco Documentation.…

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.…

Getting started with Unit Testing in Umbraco just got a whole lot easier!

Around two years ago Umbraco version 8 was released and I was scanning the internet trying to find some documentation on how to do Unit Testing in version 8, without any luck. No examples or tutorials had yet to be made for this and the official documentation did not have a section on Unit Testing. So I thought: How hard can it be?…

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.…