I want to write unit test but not getting how i can wrte unit test for the following this is my service class
export class TourStoreServiceService {
private readonly commandMap = new Map<string, BaseCommand>();
private readonly functionMap = new Map();
private readonly componentMap = new Map();
private sessionId: string;
private sessionGenerator: () => string = () => uuidv4();
constructor(@Inject(LOCAL_STORAGE) private readonly storage: StorageService) {
}
}
I want to test the following functions
public registerFnRef(key, fn: () => void): void {
this.functionMap.set(key, fn);
}
public registerComponent(key, component: Type<unknown>) {
this.componentMap.set(key, component);
}
public getFnByKey(key): Function {
return this.functionMap.get(key);
}
public getComponentByKey(key): Type<unknown> {
return this.componentMap.get(key);
}
public generateSessionId(): void {
this.sessionId = this.sessionGenerator();
this.storage.set('TOUR_SESSION_ID', this.sessionId);
}