File

src/app/tests/mocks/shared-about.ts

Description

Mock for SharedAboutService.

Example

Index

Properties
Methods

Constructor

constructor(dataflowVersionInfo?: AboutInfo)
Parameters :
Name Type Optional Description
dataflowVersionInfo AboutInfo true

Methods

getAboutInfo
getAboutInfo()
Returns : Observable<any>
getFeatureInfo
getFeatureInfo()

Properties

Public aboutInfo
aboutInfo: any
Type : any
Public dataflowVersionInfo
dataflowVersionInfo: AboutInfo
Type : AboutInfo
Public featureInfo
featureInfo:
Public featureInfoSubject
featureInfoSubject:
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);
    });
  }

}

results matching ""

    No results matching ""