protected void Application_Start()
        {
            //IApplicationRepository repository = new AdhocApplicationRepository();

            ApplicationContextBase context = new ApplicationContext();
            IApplicationRepository repository = new StandardApplicationRepository(context);
            var activator = new CustomHttpControllerActivator(repository);

            GlobalConfiguration.Configuration.Services.Replace(typeof(IHttpControllerActivator), activator);
            GlobalConfiguration.Configure(WebApiConfig.Register);
        }
        public void ApplicationContext_ShouldConnectToDatabaseSuccessfully_WhenLocalConnectionHasBeenSpecified()
        {
            // Arrange
              var underTest = new ApplicationContext();
              Database.SetInitializer(new ApplicationDbTestInitializer<ApplicationContext>());

              // Act
              var result = underTest.Superheroes.SingleOrDefault();

              // Assert
              Assert.That(result, Is.Not.Null);
              Assert.That(result.Name, Is.EqualTo("Batman"));
              Assert.That(result.Skills.Count, Is.EqualTo(2));
        }