Unit testing Observables in .NET

In one of our applications we’ve been using mongodb’s change streams to listen to changes in the database and then broadcast them using signalr for a truly reactive experience. We create an Observable (with Observable.Create) and listen to changes within the lambda passed to it. Every time a change is detected, we emit a new […]

Stream vs Promise Asynchronicity

I recently┬áhit a stumbling block whilst testing asynchronous javascript. My code needed to make a call to the server from the browser, so I decided to use a Promise as an abstraction in order to stub it out. I chose the bluebird library, as it’s incredibly popular, performant and adheres to the Promises/A+ spec. Unfortunately […]

The trouble with shims

Shims are described in Michael Feather’s book on legacy code as a stepping stone on the path to dependency inversion – they are a technique for breaking apart untestable code. Visual Studio 2012 ships with some libraries that are able to magically intercept and manipulate calls to code that are normally untouchable – even .NET […]