/**
 * Copyright 2017 - 2018  The Hyve B.V.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */ import { Cohort } from '../../models/cohort-models/cohort' ; import { CountItem } from '../../models/aggregate-models/count-item' ; import { Subject } from 'rxjs' ; import { Constraint } from '../../models/constraint-models/constraint' ; export class CohortServiceMock { private _cohorts : Cohort [ ] = [ ] ; counts : CountItem ; allCounts : CountItem ; cohortsUpdated : Subject < Cohort [ ] > = new Subject < Cohort [ ] > ( ) ; constructor ( ) { this . initializeCounts ( ) ; } initializeCounts ( ) { this . allCounts = new CountItem ( 0 , 0 ) ; this . counts = new CountItem ( 0 , 0 ) ; } public updateCountsWithCurrentCohort ( initialUpdate ? ) { return new Promise < any > ( resolve => { resolve ( true ) ; } ) ; } get allSelectedCohortsConstraint ( ) : Constraint [ ] { return [ ] ; } get selectedCohorts ( ) : Cohort [ ] { return this . cohorts . filter ( cohort => cohort . selected ) ; } get cohorts ( ) : Cohort [ ] { return this . _cohorts ; } set cohorts ( value ) { this . _cohorts = value ; } saveCohortByName ( name ) { } saveCohortByObject ( obj ) { } toggleCohortSubscription ( target ) { } toggleCohortBookmark ( target ) { } restoreCohort ( target ) { } deleteCohort ( target ) { } editCohort ( target , obj ) { } }