Marc Duiker

I ❤ Serverless

Visual Studio Snippet for Extension Methods

Extension method snippet

Extension methods

Using extension methods in Visual Studio can really help to reduce writing boilerplate code. Here’s a simple snippet which can be used to create extension methods.

After importing the snippet via Tools > Code Snippets Manager you can use it by typing exm[TAB].

Sitecore Introduction for Developers

Sitecore introduction for programmers


At a recent TechTalk at my employer I gave a presentation about Sitecore. The presentation was targeted towards developers who have no experience with Sitecore whatsoever. I had 30 minutes to explain and show what Sitecore is and that was the biggest challenge of the presentation, there is just too much to tell! Next time I’ll focus on one topic and go more in depth.

The HTML5 presentation is made with reveal.js and I’ve uploaded it to Azure using Dropbox (super easy!).

Have a look and feel free to share and reuse it!

Presentations for Programmers

Presentations for programmers

Great Slides + Great Speaker = Great Presentation

In the last few years I find myself doing more and more (technical) presentations. I have to admit I even start to like it. I absolutely admire great speakers like Scott Hanselman (Microsoft) and Tim Ward (Sitecore/CluedIn). They speak with such passion about technology that I immediately want to use or do whatever they promote. Although my presentation skills are nowhere near the level of these speakers I do have a good grasp of what makes a great presentation. So before becoming a great speaker lets start with creating great slides.

Visual Studio Snippets for Unit Test Methods

NUnit test snippet

Unit Test Method Naming

As mentioned in a previous post, having a clear naming convention for unit test methods is important to keep tests readable and maintainable. Sticking to the convention might be difficult at first and require some discipline but is definitely worth it in the long run.

Visual Studio Snippets

In order to make it easy for myself (and other developers) to use the <UnitOfWork> _ <StateUnderTest> _ <ExpectedBehaviour> naming convention, I’ve created two code snippets, one for NUnit and one for MSTest. After importing the snippets (see below) you can use the them by typing:

nutest[TAB] (for NUnit)


mstest[TAB] (for MSTest)

The resulting code is displayed at the top of this post. The snippets use three placeholders (marked in yellow) which make up the method name using the suggested convention. In addition I’ve added Arrange, Act, Assert comments in order to help structuring the test.

The Importance of Good Unit Tests and Test Reviews

GOTO by xkcd

I’m currently following an online TDD course by Roy Osherove. I’m about half way through and although I have quite a bit of experience writing unit tests and using test frameworks I’ve gained a lot of knowledge from the course already. Here are some highlights about good unit tests and test reviews.

Good Unit Tests

Roy stresses the importance of the three pillars of a good unit test:

  1. Readability
  2. Maintainability
  3. Trustworthiness

If any of these are not taken into account during development developers are likely to drop unit tests all together because it will become a burden to use instead of an aid.

Marc Duiker profile

Marc Duiker

Lead Consultant @ Xpirit

Twitter || LinkedIn || Github