Testing dependency registrations with Castle Windsor

Until recently one of the most frustrating bugs I have routinely found in my own code is incomplete dependency registrations.

It's a scenario I'm sure everyone is familiar with - you've just written some new components and got the unit tests passing, so now it's time to fire up the application and see your creations in action. Then as soon as the application starts it falls over because you forgot to add your new components to the IOC container, leaving you with unresolvable dependencies.

I would curse my own forgetfulness as I fixed the problem and would often think to myself that it would be really handy if there was a way to test your dependency registrations. I was pleasantly surprised then to find out that Castle Windsor supports exactly these kinds of tests.

Continue reading »

FSI, PsExec and Console.Clear

I recently struggled with an error that I encountered during the process of setting up a continuous deployment TFS build and I thought that I would write briefly about it in the hope of helping anyone else running into the same issue. The issue arises running FSI remotely using PsExec.

Continue reading »

Modeling Mars rovers with F#

Although currently somewhat overshadowed by ESA's amazing Rosetta mission, Mars rovers are awesome in their own right. So when a colleague pointed me in the direction of an interview puzzle about modeling Mars rovers and mentioned that he was writing an (immutable) F# implementation I decided to follow suit and have a go myself.

Continue reading »

Beyond Earth - the good, the bad and the ugly

One of the first games I can remember playing was Sid Meier's Civilization on a black and white 286 PC. I've played every game in the Civilization series apart from Alpha Centurai - I'm not sure how I missed it, but I did. So I was both excited and wary of Beyond Earth - on the one hand it promised to add a novel twist on the standard Civ formula, but on the other hand there was no guarantee that twist would work out.

So, after a week or so of playing here's my good, bad and ugly of Beyond Earth.

Continue reading »

Implementing a simple IHttpActionResult

I've recently started a new project which uses Microsoft's Web API framework to create a RESTful version of our product's API. We chose Web API because the team were familiar with it and it's quick and easy to get up and running. However, as with other Microsoft frameworks, things can get more complicated than they seemingly need to be when you try and move away from the simple "Hello, World" type examples on MSDN.

I ran into one of these situations when I wanted to respond to a request with a status code other than 200 and include a message body. In this post I will explain the scenario, the available options and the solution I eventually arrived at.

Continue reading »