title: Is it possible to override a named registration in Castle Windsor 3?
body: <p>I have two interfaces, <code>IExampleClient</code> and <code>IServiceUsingClient</code>. Each has two implementations. They are registered in a Castle Windsor installer as follows:</p>
  
  <pre><code>        container.Register(Component.For&lt;IExampleClient&gt;()
              .ImplementedBy&lt;FirstClient&gt;()
              .LifestyleTransient()
              .Named("FirstClient"));
  
          container.Register(Component.For&lt;IExampleClient&gt;()
              .ImplementedBy&lt;SecondClient&gt;()
              .LifestyleTransient()
              .Named("SecondClient"));
  
          container.Register(Component.For&lt;IServiceUsingClient&gt;()
              .ImplementedBy&lt;FirstService&gt;()
              .LifestyleTransient()
              .Named("FirstService")
              .DependsOn(Dependency.OnComponent(typeof(IExampleClient), "FirstClient")));
  
          container.Register(Component.For&lt;IServiceUsingClient&gt;()
              .ImplementedBy&lt;SecondService&gt;()
              .LifestyleTransient()
              .Named("SecondService")
              .DependsOn(Dependency.OnComponent(typeof(IExampleClient), "SecondClient")));
  </code></pre>
  
  <p>See that both implementations of IServiceUsingClient depend on a different implementation of IExampleClient. To make this work I've used the <code>DependsOn</code> method to ensure a specific named registration is used.</p>
  
  <p>I now have a set of component tests in which I want to mock the IExampleClient implementations. Normally I'd do this by overriding the registration using the <code>IsDefault()</code> option. However, because these are <em>named</em> registrations I can't do this. Castle complains that there's already a registration with the supplied name. However, if I register with a different name then my <code>IServiceUsingClient</code> will get my real implementations, not my mocks.</p>
  
  <p>I'm hoping that I'm overlooking a technique that will achieve my goal without me having to override the entire dependency chain in my tests. Any ideas?</p>