title: How to unit test a Angular 4 component which uses router.paramMap
body: <p>I m new to angular 4 and trying to test one of the angular 4 feature router.paramMap from unit tests, Reading route params in fallowing way and working as expected in my application.</p>
  
  <pre><code>constructor(private router:Router, private actRoute:ActivatedRoute) {
  }
  
  ngOnInit() {
      this.router.paramMap.subscribe(params =&gt; {
          params.get(id);
      })
  ......
  }
  </code></pre>
  
  <p>But while running unit test, i m getting error which says cannot call subscribe method of undefined even though i m passing passing route param as below.</p>
  
  <pre><code>{
    provide: ActivatedRoute,
    useValue: { params: Observable.of({id: 1}) }
  }
  </code></pre>
  
  <p>Please suggest </p>