import { convertToParamMap , ParamMap , Params } from '@angular/router' ; import { ReplaySubject } from 'rxjs' ; /**
 * An ActivateRoute test double with a `paramMap` observable.
 * Use the `setParamMap()` method to add the next `paramMap` value.
 */ export class ActivatedRouteMock { private subject = new ReplaySubject < ParamMap > ( ) ; constructor ( initialParams ? ) { this . setParamMap ( initialParams ) ; } /** The mock paramMap observable */ readonly paramMap = this . subject . asObservable ( ) ; /** Set the paramMap observables's next value */ setParamMap ( params ? ) { this . subject . next ( convertToParamMap ( params ) ) ; } }