Blog Archives

Using mocha and sinon for client side testing

Returning to the MotorDB project, https://github.com/thesoftwaredude/MotorDB, I have unit tests of the controllers, but nothing for testing the client side code. I have been reading recently about the various javascript testing frameworks, and decided that I want to try using mocha

Tagged with: , , , ,
Posted in mocha, sinon, TDD, Typescript

Using IHttpActionResult with WebAPI2

This is another post relating to the new features in WebApi2. When you start a new WebAPI controller, the template used is Once you start working with the WebAPI, you soon realize that this is not enough, as you need

Tagged with: ,
Posted in TDD, WebAPI

The Chain of Responsibility Pattern – Or how to over engineer FizzBuzz

What is FizzBuzz Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both

Tagged with: ,
Posted in Design Patterns, TDD

Using the command pattern to solve the Mars Rover Kata – Part 3

This is the third and final part to solve the Mars Rover kata. Part 1 and Part 2 to view what has been done previously. The Command Pattern The Command Pattern encapsulates a request as an object, thereby letting you

Tagged with: , , ,
Posted in Kata, Mars Rover, TDD

Using the State Pattern to solve the Mars Rover Kata – Part 1

If you have not come across this kata before, this is it: A Mars Rover has been developed to map out the landscape. It’s a small robot which can move on a grid, controlled by simple commands. In this example,

Tagged with: , , , , ,
Posted in Kata, Mars Rover, TDD

Creating Policy API using the MVC4 ApiController

I wanted to start on my project, and I thought the first thing to start on was to display a list of policies. As I want to have a Single Page Application, I have started out creating an API. Roy Fielding is

Tagged with: , ,
Posted in MotorDB, REST, TDD

Know your tools

I have been using Moq for so long that when I start to write tests, i start writing on automatic and not even think about what I type. I was busy refactoring some code that I have inherited which of

Posted in Moq, TDD

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 12 other followers