diff --git a/aio/src/testing/location.service.ts b/aio/src/testing/location.service.ts new file mode 100644 index 0000000000..2d3ae9d64d --- /dev/null +++ b/aio/src/testing/location.service.ts @@ -0,0 +1,8 @@ +import { BehaviorSubject } from 'rxjs/BehaviorSubject'; + +export class MockLocationService { + urlSubject = new BehaviorSubject(this.initialUrl); + currentUrl = this.urlSubject.asObservable(); + constructor(private initialUrl) {} +} + diff --git a/aio/src/testing/logger.service.ts b/aio/src/testing/logger.service.ts new file mode 100644 index 0000000000..999526c402 --- /dev/null +++ b/aio/src/testing/logger.service.ts @@ -0,0 +1,23 @@ +import { Injectable } from '@angular/core'; + +@Injectable() +export class MockLogger { + + output = { + log: [], + error: [], + warn: [] + }; + + log(value: any, ...rest) { + this.output.log.push([value, ...rest]); + } + + error(value: any, ...rest) { + this.output.error.push([value, ...rest]); + } + + warn(value: any, ...rest) { + this.output.warn.push([value, ...rest]); + } +}