title: Ninject in Unit test
body: <p>I'm trying to run some unit tests that need dependency injection, but I have a problem because I don´t know how to use Ninject on the test.
  This is my code:</p>
  
  <pre><code>//[Inject]
  private AppServer appServer;
  
      [TestMethod]
      public void testInstantiation() {
          //var kernel = NinjectWebCommon.CreatePublicKernel();
          //appServer = kernel.Resolve&lt;AppServer&gt;();
  
          Assert.IsNotNull(appServer, "Server instance is null");
          Assert.IsNotNull(appServer.getEventStore(), "Event store cannot is null");
  </code></pre>
  
  <p>Inject annotation is commented because I think It doesn´t work and the below lines of testInstantiation() are any possible solution that I found in other question here but It doesn't work for me because resolve method requests an interface and AppServer is a class.</p>
  
  <p>This is part of AppServer class</p>
  
  <pre><code>    private EventStore eventStore;  
  
      public EventStore getEventStore() {
          return eventStore;
      }
  
      [Inject]
      public void setEventStore(EventStore eventStore) {
          this.eventStore = eventStore;
      }
  </code></pre>
  
  <p>Just now, the AppServer declaration in my unit test has a warning: "Field never assigned to, and will always have its default value null".</p>
  
  <p>StackOverFlow has a lot solutions to Ninject in Unit test but all are related with interfaces. I don't use interfaces.</p>
  
  <p>Can anybody help me? I don´t know how to do this.</p>