src/app/tests/mocks/shared-about.ts
Mock for SharedAboutService.
Properties |
|
Methods |
constructor(dataflowVersionInfo?: AboutInfo)
|
||||||||
Defined in src/app/tests/mocks/shared-about.ts:16
|
||||||||
Parameters :
|
getAboutInfo |
getAboutInfo()
|
Defined in src/app/tests/mocks/shared-about.ts:22
|
Returns :
Observable<any>
|
getFeatureInfo |
getFeatureInfo()
|
Defined in src/app/tests/mocks/shared-about.ts:31
|
Returns :
Observable<FeatureInfo>
|
Public aboutInfo |
aboutInfo:
|
Type : any
|
Defined in src/app/tests/mocks/shared-about.ts:12
|
Public dataflowVersionInfo |
dataflowVersionInfo:
|
Type : AboutInfo
|
Defined in src/app/tests/mocks/shared-about.ts:16
|
Public featureInfo |
featureInfo:
|
Defined in src/app/tests/mocks/shared-about.ts:13
|
Public featureInfoSubject |
featureInfoSubject:
|
Defined in src/app/tests/mocks/shared-about.ts:14
|
import { Observable, Subject, of } from 'rxjs';
import { FeatureInfo } from '../../shared/model/about/feature-info.model';
import { AboutInfo } from '../../shared/model/about/about-info.model';
/**
* Mock for SharedAboutService.
*
* @author Gunnar Hillert
*/
export class MocksSharedAboutService {
public aboutInfo: any;
public featureInfo = new FeatureInfo();
public featureInfoSubject = new Subject<FeatureInfo>();
public dataflowVersionInfo: AboutInfo;
constructor(dataflowVersionInfo?: AboutInfo) {
this.dataflowVersionInfo = dataflowVersionInfo ? dataflowVersionInfo : new AboutInfo();
}
getAboutInfo(): Observable<any> {
this.aboutInfo = this.dataflowVersionInfo;
this.featureInfo = new FeatureInfo().deserialize(this.dataflowVersionInfo.featureInfo);
this.featureInfoSubject.next(this.featureInfo);
return of(this.dataflowVersionInfo);
}
getFeatureInfo(): Observable<FeatureInfo> {
return this.getAboutInfo().map(result => {
return new FeatureInfo().deserialize(result.featureInfo);
});
}
}