title: Testing - Can't resolve all parameters for (ClassName)
body: <h2 id="context-9xm5">Context</h2>
  <p>I created an <code>ApiService</code> class to be able to handle our custom API queries, while using our own serializer + other features.</p>
  <p><code>ApiService</code>'s constructor signature is:</p>
  <pre class="lang-js prettyprint-override"><code>constructor(metaManager: MetaManager, connector: ApiConnectorService, eventDispatcher: EventDispatcher);
  </code></pre>
  <ul>
  <li><code>MetaManager</code> is an injectable service that handles api's metadatas.</li>
  <li><code>ApiConnectorService</code> is a service which is wrapping <code>Http</code> to add our custom headers and signature system.</li>
  <li><code>EventDispatcher</code> is basically Symfony's event dispatcher system, in typescript.</li>
  </ul>
  <h2 id="problem-mi9s">Problem</h2>
  <p>When I test the <code>ApiService</code>, I do an initialization in <code>beforeEach</code>:</p>
  <pre class="lang-js prettyprint-override"><code>beforeEach(async(() =&gt; {
      TestBed.configureTestingModule({
          imports  : [
              HttpModule
          ],
          providers: [
              ApiConnectorService,
              ApiService,
              MetaManager,
              EventDispatcher,
              OFF_LOGGER_PROVIDERS
          ]
      });
  }));
  </code></pre>
  <p>and it works fine.</p>
  <p>Then I add my second spec file, which is for <code>ApiConnectorService</code>, with this <code>beforeEach</code>:</p>
  <pre class="lang-js prettyprint-override"><code>beforeEach(async(() =&gt; {
      TestBed.configureTestingModule({
          imports  : [HttpModule],
          providers: [
              ApiConnectorService,
              OFF_LOGGER_PROVIDERS,
              AuthenticationManager,
              EventDispatcher
          ]
      });
  }));
  </code></pre>
  <p>And all the tests fail with this error:</p>
  <blockquote>
  <p>Error: Can't resolve all parameters for ApiService: (MetaManager, ?, EventDispatcher).</p>
  </blockquote>
  <ul>
  <li>If I remove <code>api-connector-service.spec.ts</code> (<code>ApiConnectorService</code>'s spec file) from my loaded tests, <code>ApiService</code>'s tests will succeed.</li>
  <li>If I remove <code>api-service.spec.ts</code> (<code>ApiService</code>'s spec file) from my loaded tests, <code>ApiConnectorService</code>'s tests will succeed.</li>
  </ul>
  <p>Why do I have this error? It seems like the context between my two files are in conflict and I don't know why and how to fix this.</p>