import { Expectation } from '../expectation/expectation' ; export interface InvocationCount { /**
     * Expect a call to be made at least `min` times and at most `max` times.
     */ between ( min , max ) : void ; /**
     * Expect a call to be made exactly `exact` times.
     *
     * Shortcut for `between(exact, exact)`.
     */ times ( exact ) : void ; /**
     * Expect a call to be made any number of times, including never.
     *
     * Shortcut for `between(0, Infinity)`.
     */ anyTimes ( ) : void ; /**
     * Expect a call to be made at least `min` times.
     *
     * Shortcut for `between(min, Infinity)`.
     */ atLeast ( min ) : void ; /**
     * Expect a call to be made at most `max` times.
     *
     * Shortcut for `between(0, max)`.
     */ atMost ( max ) : void ; /**
     * Expect a call to be made exactly once.
     *
     * Shortcut for `times(1)`.
     */ once ( ) : void ; /**
     * Expect a call to be made exactly twice.
     *
     * Shortcut for `times(2)`.
     */ twice ( ) : void ; } export const createInvocationCount = ( expectation ) : InvocationCount => ( { between ( min , max ) { expectation . setInvocationCount ( min , max ) ; } , times ( exact ) { expectation . setInvocationCount ( exact , exact ) ; } , anyTimes ( ) { expectation . setInvocationCount ( 0 , 0 ) ; } , atLeast ( min ) { expectation . setInvocationCount ( min , Infinity ) ; } , atMost ( max ) { expectation . setInvocationCount ( 0 , max ) ; } , once ( ) { expectation . setInvocationCount ( 1 , 1 ) ; } , twice ( ) { expectation . setInvocationCount ( 2 , 2 ) ; } , } ) ;