title: Dependency Injection for concrete .Net classes
body: <p>What is the preferred way for injecting/isolating classes that are sealed in dlls and do not implement interfaces?</p>
  
  <p>We use Ninject.</p>
  
  <p>Let's say that we have a class "Server" and we want to inject/isolate the class TcpServer which "Server" uses.</p>
  
  <p>Don't want to be too specific because I want to know the best way, but let's say something like that:</p>
  
  <pre><code>public class Server 
  {
      IServer _server;
      public Server(IServer server) 
      { 
          _server = server;
      }
  
      public void DoSomething()
      {
          _server.DoSomething();     
      }
  }
  </code></pre>
  
  <p><code>_server</code> should be injected with, let's say, TcpClient or mock in case of testing</p>