Mike Larah's Blog

This post will go through how to write unit tests for your AngularJS app using Jasmine, how to run those tests in Visual Studio with ReSharper and the PhantomJS headless browser, and how to add a build step to your TeamCity CI pipeline to run the tests. The source code for the demo app is available […]


Restrict access to Azure Websites by whitelisting

by Mike Larah

By utilising the IP and Domain Restrictions feature in IIS (available since IIS7), it possible to lock down your Azure Website to only allow access to IP addresses and domains that you have specified in a whitelist. To allow a single IPv4 address, add the following node to your web.config: To allow access from a […]


When you run your cloud services in Azure, it is possible to change your configuration settings (app settings, number of instances, etc.) whilst your service is running – either via the Azure portal or the service management API. However, you may want to test how your application responds to these config changes whilst running locally […]


In the previous posts I’ve explained how to set up installers in your application, how to use the content factory, and how to set up the composition framework for ASP.NET. In this post I will show you how to debug the container. If you try to resolve a component that has missing dependencies, the Container will […]


To use endjin composition framework with an ASP.NET MVC 4/WebAPI application, firstly pull in the Endjin.Core.Composition.Web package from NuGet. Following the steps from the previous posts, you can set up your interfaces, concrete types and installers. No further initialization is required though – the package includes extensions for configuring and initializing the container, and also […]


As I explained in this post, the framework provides a set of installers for registering components against interfaces in the container. Another powerful tool in the composition framework is the ContentFactory. This provides methods for registering and getting content based on a contentType string. When getting content, if the contentType is not found in the […]


In the last post I introduced v2.0 of our open source, composition framework. In this post, I’m going to cover a quick example of how to get started with the basics of the endjin composition framework. Firstly, we define an interface for some type Then, we create a concrete type for our interface Now we can […]


We’ve just pushed out version 2.0 of our open-source, component composition framework. This is the framework we use internally day-in, day-out for our dependency injection. The previous version had a dependency on Castle Windsor, but in this new version we have implemented our own container. There are a few reasons we decided to take this […]


Background Twilio is a cloud based voice and SMS service and this post will show you how easy it is to create your own inbound voice application using MVC 4 Web API. The basic premise of how it works is Twilio parses a form of XML called ‘TwiML’, which contains various verbs telling Twilio what […]


Integration testing with Web API

by Mike Larah

I recently had do a project where I wanted to run integration tests on some Web API controllers, so this post is to describe the method for doing so. The way to do it is to mock an HttpServer and HttpClient class, but first you have to change some of the config to get them […]