base.service.ts
export class BaseService {
constructor(private http:Http){}
search(segment: string, param: string){
//build url
this.http.get(....){}
}
}
my.service.ts
export class MyService {
constructor(private baseService:Baservice){}
search(segment: string, param: string){
//build url
this.baseService.search('people','1'){}
}
}
Base Service is a generic service that will build url and get data from server and return observable.
Now I want to put MyService under test. How can I mock Base Service because the different data sets will be returned with different 'segment' and 'param'
Thanks