Setting up Ninject for Web Api became fairly straightforward. It's just a matter of adding Ninject integration for WebApi 2 Nuget package. Assuming that web site has NinjectWebCommon class and custom resolver, this Web Api controller works just fine:

    public class TrafficController : ApiController
    {
        private readonly ILoggingRepository _repository;

        public TrafficController(ILoggingRepository repository)                
        {        
            _repository = repository;            
        }

        [Route("api/traffic")]
        public IList<TrafficItem> Get (long? accountId, string userName)
        {
            // Get stuff
        }        
    }

There's a bit more work needed in order to run integration tests with self-hosted Web Api. Self-hosted means that I want to host Web Api in the integration tests.

In order to make this happen I have a base integration test class:

    [TestFixture]
    public class WebApiBaseTest
    {
        protected HttpClient _client;
        private HttpServer _server;

        [TestFixtureSetUp]
        protected void Setup()
        {       
            NinjectWebCommon.Start();

            var config = new HttpConfiguration();
            config.DependencyResolver = GlobalConfiguration.Configuration.DependencyResolver;            
            WebApiConfig.Register(config);
            _server = new HttpServer(config);            
            _client = new HttpClient(_server);
        }
        [TestFixtureTearDown]
        protected void TearDown()
        {
            _server.Dispose();
            NinjectWebCommon.Stop();
        }        

        protected string MakeUri(string uri)
        {
            return string.Format("http://localhost:3000/api/{0}", uri);
        }
    }

NinjectWebCommon and WebApiConfig classes are located in the main MVC project.

I create a new configuration and set its resolver to the one already configured by Ninject:

config.DependencyResolver = GlobalConfiguration.Configuration.DependencyResolver;  

With this in place, integration testing is very easy:

        [Test]        
        public void TrafficController_Get()
        {
            var resultString = _client.GetStringAsync(MakeUri("traffic?accountId=&userName=")).Result;
            var items = JsonConvert.DeserializeObject<List<TrafficItem>>(resultString);
            Assert.IsNotNull(items);
        }

This runs fine as long as all tests are in the same test fixture, but after tests in first test fixture ran, any tests in another fixture will fail because Ninject doesn't like to be stopped and restarted. The solution for this would be to start and stop Ninject only once for all tests:

[SetUpFixture]
public class NinjectSetupFixture  
{
    [SetUp]
    public void Setup()
    {
        NinjectWebCommon.Start();
    }

    [TearDown]
    public void TearDown()
    {
        NinjectWebCommon.Stop();
    }
}

This will run before and after tests in the namespace.