title: How to dependency inject interface in angular 6 unit test
body: <p>One of the service dependency injects an interface in the constructor. I wonder, how I can dependency injects the interface in the unit test?</p>
  
  <p>Exported interface:</p>
  
  <pre><code>export interface MobilePlatform {
    onClick(): void;
    onPageFinished(router: Router): void;
    onPageStart(): void;
    sendClose(): void;
    tts(text: String): void;
  }
  </code></pre>
  
  <p>Service injects the interface in the constructor</p>
  
  <pre><code>constructor(private platform: MobilePlatform, private router: Router) {}
  </code></pre>
  
  <p>How I can inject this interface in the angular unit test?</p>
  
  <pre><code>describe('MobileActions', () =&gt; {
    let actions: MobileActions;
    let platform: MobilePlatform;
  
    beforeEach(() =&gt; {
  
      TestBed.configureTestingModule({
        providers: [
          MobileActions,
          { provide: MobilePlatform, useClass: MockMobilePlatform },
          { provide: Router, useClass: MockRouter }
        ]
      });
  
      actions = TestBed.get(MobileActions);
      platform = TestBed.get(MockMobilePlatform);
    });
  
    it('should create actions', () =&gt; {
      expect(actions).toBeTruthy();
      expect(platform).toBeTruthy();
    });
  });
  </code></pre>
  
  <p>Seems this kind of inject failed.</p>