import { Property } from '../../proxy' ; import { Expectation , ReturnValue } from '../expectation' ; import { ExpectationRepository } from './expectation-repository' ; export class OneIncomingExpectationRepository implements ExpectationRepository { public expectation : Expectation | undefined ; add ( expectation ) { this . expectation = expectation ; } get ( ) { if ( ! this . expectation ) { throw new Error ( ) ; } return this . expectation . returnValue ; } getAllProperties ( ) { return [ ] ; } getUnmet ( ) { return this . expectation ? [ this . expectation ] : [ ] ; } clear ( ) { this . expectation = undefined ; } getCallStats = ( ) => ( { expected : new Map ( ) , unexpected : new Map ( ) } ) ; }