{"version":3,"sources":["jsdelivr-header.js","/npm/typemoq@2.1.0/dist/Api/Api/Api/MockBehavior.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/ExpectedCallType.ts","/npm/typemoq@2.1.0/dist/Error/Error/Error/MockException.ts","/npm/typemoq@2.1.0/dist/Error/Error/Error/Exception.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/ICallContext.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/Times.ts","/npm/typemoq@2.1.0/dist/Common/Common/Common/PropertyRetriever.ts","/npm/typemoq@2.1.0/dist/Consts.ts","/npm/typemoq@2.1.0/dist/Match/Match/Match/Match.ts","/npm/typemoq@2.1.0/dist/Common/Common/Common/Utils.ts","/npm/typemoq@2.1.0/dist/Match/Match/Match/MatchAny.ts","/npm/typemoq@2.1.0/dist/Match/Match/Match/MatchPred.ts","/npm/typemoq@2.1.0/dist/Match/Match/Match/MatchValue.ts","/npm/typemoq@2.1.0/dist/Match/Match/Match/MatchObjectWith.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/Invocation.ts","/npm/typemoq@2.1.0/dist/InterceptorContext.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/ProxyES5.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/ProxyES6.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/ProxyES6Handler.ts","/npm/typemoq@2.1.0/dist/Proxy/Proxy/Proxy/ProxyFactory.ts","/npm/typemoq@2.1.0/dist/MockBase.ts","/npm/typemoq@2.1.0/dist/GlobalMock.ts","/npm/typemoq@2.1.0/dist/CurrentInterceptContext.ts","/npm/typemoq@2.1.0/dist/InterceptorStrategies.ts","/npm/typemoq@2.1.0/dist/InterceptorExecute.ts","/npm/typemoq@2.1.0/dist/InterceptorSetup.ts","/npm/typemoq@2.1.0/dist/MethodCall.ts","/npm/typemoq@2.1.0/dist/MethodCallReturn.ts","/npm/typemoq@2.1.0/dist/StaticMock.ts","/npm/typemoq@2.1.0/dist/DynamicMock.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/MockApi.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/It.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/GlobalMockApi.ts","/npm/typemoq@2.1.0/dist/GlobalScope.ts","/npm/typemoq@2.1.0/dist/Api/Api/Api/GlobalScopeApi.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,yQCNA,IAAY,ECAA,GDAA,kCAAY,KAAG,EAAA,iBAAO,IAAA,oBCAtB,0CAAgB,KAAG,EAAA,2BAAY,IAAA,2B,MCE/B,E,sRCFZ,EAAA,SAAA,GACI,SAAA,EAAmB,EAAc,GAAjC,IAAA,EACI,EAAA,KAAA,KAAM,IAAQ,K,OADC,EAAA,OAEf,OAAO,eAAe,EAAM,EAAU,W,EAO9C,OAV+B,OAM3B,EAAA,UAAA,SAAA,WAEI,OADa,KAAK,QAAa,KAAK,KAAI,MAAM,KAAK,QAAY,KAAK,I,EAG5E,C,CAVA,CAA+B,O,8SDE/B,SAAY,GACR,IAAA,QAAe,iCAA+B,UAC9C,IAAA,iBAAwB,4CAA0C,mBAClE,IAAA,WAAkB,oBAAkB,aACpC,IAAA,aAAoB,4BAA0B,eAC9C,IAAA,eAAsB,+BAA6B,iBACnD,IAAA,kBAAyB,uBAAqB,oBAC9C,IAAA,4BAAmC,wCAAsC,8BACzE,IAAA,4BAAmC,wCAAsC,8BACzE,IAAA,2BAAkC,iCAA+B,4BACpE,CAVD,CAAY,MAAmB,KAY/B,IEZY,EAIA,EFQZ,EAAA,SAAA,GACI,SAAA,EACoB,EACA,EACA,QAAA,IAAA,WAAA,GAHpB,IAAA,EAII,EAAA,KAAA,KAAM,gBAAiB,IAAQ,K,OAHf,EAAA,SACA,EAAA,MACA,EAAA,UAEhB,OAAO,eAAe,EAAM,EAAc,W,EASlD,OAfmC,OAS/B,EAAA,UAAA,SAAA,WACI,IAAI,EAAY,K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,QAAQ,IAAI,MAAM,E,MAK9B,EAAO,MAAM,KAAM,KAAK,M,CAE1B,MAAO,GACL,QAAQ,IAAI,MAAM,E,SAElB,OAAO,KAAK,OAAO,SAAC,GACZ,IAAI,EAA2B,EAAQ,EAAE,MAEzC,GAAI,EAAM,CAEN,OAAQ,EAAE,MAEN,KAAK,EAAW,MAGhB,KAAK,EAAW,SACZ,MAEJ,KAAK,EAAW,MACZ,EAAK,cAAe,EAM5B,IACI,OAAO,eAAe,EAAE,UAAW,EAAE,KAAM,E,CAC7C,MAAO,GACL,QAAQ,IAAI,MAAM,E,QAM9C,C,CAlFA,GCAA,GAAA,oBAAA,I,CAOA,OALW,EAAA,MAAP,W,IAAa,IAAA,EAAA,GAAA,EAAA,EAAA,EAAA,UAAA,OAAA,IAAA,EAAA,GAAA,UAAA,GAET,OADY,IAAI,GAAO,E,EAI/B,C,CAPA,G","file":"/npm/typemoq@2.1.0/dist/typemoq.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/typemoq@2.1.0/dist/typemoq.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","export enum MockBehavior { Loose, Strict }","export enum ExpectedCallType { InAnyOrder, InSequence }","import { Exception } from \"./Exception\";\r\n\r\nexport enum MockExceptionReason {\r\n    NoSetup = <any>\"no setup expression found for\",\r\n    MoreThanOneSetup = <any>\"more than one setup expression found for\",\r\n    InvalidArg = <any>\"invalid argument\",\r\n    InvalidSetup = <any>\"invalid setup expression\",\r\n    InvalidMatcher = <any>\"invalid matching expression\",\r\n    UnknownGlobalType = <any>\"unknown global type\",\r\n    CallCountVerificationFailed = <any>\"invocation count verification failed\",\r\n    CallOrderVerificationFailed = <any>\"invocation order verification failed\",\r\n    InvalidDynamicProxyRuntime = <any>\"invalid dynamic proxy runtime\"\r\n}\r\n\r\nexport class MockException extends Exception {\r\n    constructor(\r\n        public readonly reason: MockExceptionReason,\r\n        public readonly ctx: any,\r\n        public readonly message: string = undefined) {\r\n        super(\"MockException\", message);\r\n        Object.setPrototypeOf(this, MockException.prototype);\r\n    }\r\n\r\n    toString(): string {\r\n        let errMsg = `${this.name} - ${this.reason}`;\r\n        if (this.message)\r\n            errMsg = `${errMsg} (${this.message})`;\r\n        return errMsg;\r\n    }\r\n}","export class Exception extends Error {\r\n    constructor(public name: string, message: string) {\r\n        super(message);\r\n        Object.setPrototypeOf(this, Exception.prototype);\r\n    }\r\n\r\n    toString(): string {\r\n        let errMsg = this.message ? `${this.name} - ${this.message}` : this.name;\r\n        return errMsg;\r\n    }\r\n}\r\n","import { IPropertyInfo, InvocationType } from \"./Invocation\";\r\n\r\nexport enum CallType {\r\n    UNKNOWN, PROPERTY, FUNCTION\r\n}\r\n\r\nexport enum ProxyType {\r\n    STATIC, DYNAMIC\r\n}\r\n\r\nexport interface ICallContext {\r\n    args: IArguments;\r\n    property: IPropertyInfo;\r\n    returnValue: any;\r\n    invokeBase(): void;\r\n    invocationType: InvocationType;\r\n    callType: CallType;\r\n    proxyType: ProxyType;\r\n    isAnUnknownDynamicCallAtExecution: boolean;\r\n}\r\n","import * as _ from \"lodash\";\r\nimport * as common from \"../Common/_all\";\r\nimport * as error from \"../Error/_all\";\r\nimport * as proxy from \"../Proxy/_all\";\r\n\r\nexport class Times {\r\n\r\n    private static NO_MATCHING_CALLS_EXACTLY_N_TIMES = \"expected invocation of <%= i %> exactly <%= min %> times, invoked <%= c %> times\";\r\n    private static NO_MATCHING_CALLS_AT_LEAST_N_TIMES = \"expected invocation of <%= i %> at least <%= min %> times, invoked <%= c %> times\";\r\n    private static NO_MATCHING_CALLS_AT_MOST_N_TIMES = \"expected invocation of <%= i %> at most <%= max %> times, invoked <%= c %> times\";\r\n\r\n    private _lastCallCount: number;\r\n    private _failMessage: (...data: any[]) => string;\r\n\r\n    private constructor(\r\n        private _condition: common.IFunc2<number, boolean>,\r\n        public readonly min: number,\r\n        public readonly max: number,\r\n        failMessage: string) {\r\n        this._failMessage = _.template(failMessage);\r\n    }\r\n\r\n    failMessage(call: proxy.ICallContext) {\r\n        return this._failMessage({ i: call, min: this.min, max: this.max, c: this._lastCallCount });\r\n    }\r\n\r\n    verify(callCount: number): boolean {\r\n        this._lastCallCount = callCount;\r\n        return this._condition(callCount);\r\n    }\r\n\r\n    private static checkArg(n: number, target: string) {\r\n        if (n < 0)\r\n            throw new error.MockException(error.MockExceptionReason.InvalidArg,\r\n                undefined, `${target} argument cannot be a negative number`);\r\n    }\r\n\r\n    static exactly(n: number): Times {\r\n        Times.checkArg(n, \"'Times.exactly'\");\r\n        return new Times(c => c === n, n, n, Times.NO_MATCHING_CALLS_EXACTLY_N_TIMES);\r\n    }\r\n\r\n    static atLeast(n: number): Times {\r\n        Times.checkArg(n, \"'Times.atLeast'\");\r\n        return new Times(c => c >= n, n, 255, Times.NO_MATCHING_CALLS_AT_LEAST_N_TIMES);\r\n    }\r\n\r\n    static atMost(n: number): Times {\r\n        Times.checkArg(n, \"'Times.atMost'\");\r\n        return new Times(c => c >= 0 && c <= n, 0, n, Times.NO_MATCHING_CALLS_AT_MOST_N_TIMES);\r\n    }\r\n\r\n    static never(): Times {\r\n        return Times.exactly(0);\r\n    }\r\n\r\n    static once(): Times {\r\n        return Times.exactly(1);\r\n    }\r\n\r\n    static atLeastOnce(): Times {\r\n        return Times.atLeast(1);\r\n    }\r\n\r\n    static atMostOnce(): Times {\r\n        return Times.atMost(1);\r\n    }\r\n\r\n    toString(): string {\r\n        let res = \"\";\r\n        if (this.min === this.max) {\r\n            if (this.min === 0) {\r\n                res = \"never\";\r\n            } else if (this.min === 1) {\r\n                res = \"once\";\r\n            } else {\r\n                res = `${this.min} times`;\r\n            }\r\n        } else {\r\n            if (this.min === 0 && this.max !== 255)\r\n                res = `at most ${this.max} times`;\r\n            else\r\n                res = `at least ${this.min} times`;\r\n        }\r\n        return res;\r\n    }\r\n\r\n}\r\n","import * as _ from \"lodash\";\r\nimport { PropDescriptor } from \"./PropDescriptor\";\r\n\r\nexport class PropertyRetriever {\r\n\r\n    static getOwnEnumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, false, this._enumerable);\r\n        // Or could use for..in filtered with hasOwnProperty or just this: return Object.keys(obj);\r\n    }\r\n\r\n    static getOwnNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, false, this._notEnumerable);\r\n    }\r\n\r\n    static getOwnEnumerablesAndNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, false, this._enumerableAndNotEnumerable);\r\n        // Or just use: return Object.getOwnPropertyNames(obj);\r\n    }\r\n\r\n    static getPrototypeEnumerables(obj: any) {\r\n        return this._getPropertyNames(obj, false, true, this._enumerable);\r\n    }\r\n\r\n    static getPrototypeNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, false, true, this._notEnumerable);\r\n    }\r\n\r\n    static getPrototypeEnumerablesAndNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, false, true, this._enumerableAndNotEnumerable);\r\n    }\r\n\r\n    static getOwnAndPrototypeEnumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, true, this._enumerable);\r\n        // Or could use unfiltered for..in\r\n    }\r\n\r\n    static getOwnAndPrototypeNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, true, this._notEnumerable);\r\n    }\r\n\r\n    static getOwnAndPrototypeEnumerablesAndNonenumerables(obj: any) {\r\n        return this._getPropertyNames(obj, true, true, this._enumerableAndNotEnumerable);\r\n    }\r\n\r\n    // Private static property checker callbacks\r\n    private static _enumerable(obj: any, prop: any): boolean {\r\n        return obj.propertyIsEnumerable(prop);\r\n    }\r\n\r\n    private static _notEnumerable(obj: any, prop: any): boolean {\r\n        return !obj.propertyIsEnumerable(prop);\r\n    }\r\n\r\n    private static _enumerableAndNotEnumerable(obj: any, prop: any): boolean {\r\n        return true;\r\n    }\r\n\r\n    private static _getPropertyNames(\r\n        obj: any, iterateSelfBool: boolean, iteratePrototypeBool: boolean, includePropCb: (obj: any, prop: any) => boolean):\r\n        Array<{ name: string; desc: PropDescriptor }> {\r\n\r\n        let result: Array<{ name: string; desc: PropDescriptor }> = [];\r\n\r\n        do {\r\n            if (iterateSelfBool) {\r\n\r\n                let props = Object.getOwnPropertyNames(obj);\r\n                for (let prop of props) {\r\n                    let duplicate = _.find(result, (p: { name: string; desc: PropDescriptor }) => p.name === prop);\r\n\r\n                    if (!duplicate && includePropCb(obj, prop)) {\r\n                        let propDesc = Object.getOwnPropertyDescriptor(obj, prop);\r\n                        result.push({ name: prop, desc: propDesc });\r\n                    }\r\n                };\r\n            }\r\n\r\n            if (!iteratePrototypeBool) {\r\n                break;\r\n            }\r\n\r\n            iterateSelfBool = true;\r\n\r\n        } while (obj = Object.getPrototypeOf(obj));\r\n\r\n        return result;\r\n    }\r\n\r\n}","export class Consts {\r\n    static readonly IMATCH_ID_VALUE = \"438A51D3-6864-49D7-A655-CA1153B86965\";\r\n    static readonly IMATCH_ID_NAME = \"___id\";\r\n    static readonly IMATCH_MATCHES_NAME = \"___matches\";\r\n\r\n    static readonly IPROXY_ID_VALUE = \"BCDF5CE5-F0DF-40B7-8BA0-69DF395033C8\";\r\n    static readonly IPROXY_ID_NAME = \"___id\";\r\n}","import * as _ from \"lodash\";\r\nimport { Consts } from \"../Consts\";\r\n\r\nexport class Match {\r\n\r\n    static isMatcher(x: any): boolean {\r\n        return !_.isNil(x) &&\r\n            !_.isUndefined(x[Consts.IMATCH_MATCHES_NAME]) &&\r\n            !_.isUndefined(x[Consts.IMATCH_ID_NAME]) &&\r\n            x[Consts.IMATCH_ID_NAME] === Consts.IMATCH_ID_VALUE;\r\n    }\r\n\r\n}\r\n","import * as _ from \"lodash\";\r\nimport * as CircularJSON from \"circular-json\";\r\nimport { CtorWithArgs } from \"./Ctor\";\r\nimport { PropertyRetriever } from \"./PropertyRetriever\";\r\nimport { Match } from \"../Match/Match\";\r\n\r\nexport class Utils {\r\n\r\n    static functionName(fun: Object): string {\r\n        let res: string;\r\n        if ((<any>fun).name) {\r\n            res = (<any>fun).name;\r\n        } else {\r\n            let repr = fun.toString();\r\n            repr = repr.substr(\"function \".length);\r\n            res = repr.substr(0, repr.indexOf(\"(\"));\r\n        }\r\n        return res;\r\n    }\r\n\r\n    static objectName(obj: Object): string {\r\n        let res = Utils.functionName(obj.constructor);\r\n        return res;\r\n    }\r\n\r\n    static argsName(args: IArguments): string {\r\n        let argsArray: any[] = Array.prototype.slice.call(args);\r\n        let sargs = argsArray.map((x: any) => {\r\n            let res = \"\";\r\n            if (Match.isMatcher(x)) {\r\n                res = x.toString();\r\n            }\r\n            else {\r\n                const replacer = (key: string, value: any) => {\r\n                    if (value === undefined)\r\n                        return \"undefined\";\r\n                    if (_.isFunction(value))\r\n                        return \"Function\";\r\n                    return value;\r\n                };\r\n                res = CircularJSON.stringify(x, replacer);\r\n            }\r\n            return res;\r\n        });\r\n        let res = _.join(sargs);\r\n        return res;\r\n    }\r\n\r\n    static conthunktor<U>(ctor: CtorWithArgs<U>, args: any[]): U {\r\n        let ret: U = new ctor(...args);\r\n        return ret;\r\n    }\r\n\r\n    static clone(target: Object, source: Object) {\r\n        let sourceProps = PropertyRetriever.getOwnAndPrototypeEnumerablesAndNonenumerables(source);\r\n        for (let p of sourceProps)\r\n            Object.defineProperty(target, p.name, p.desc);\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport * as common from \"../Common/_all\";\r\nimport { IMatch } from \"./IMatch\";\r\nimport { Consts } from \"../Consts\";\r\n\r\nexport class MatchAnyObject<T> implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    constructor(private readonly _ctor: common.Ctor<T>) {\r\n    }\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = false;\r\n        if (object && object.constructor.prototype == this._ctor.prototype)\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        let res = `It.isAnyObject(${common.Utils.functionName(this._ctor)})`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class MatchAny implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        return `It.isAny()`;\r\n    }\r\n}\r\n\r\nexport class MatchAnyString implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = false;\r\n        if (_.isString(object))\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        return `It.isAnyString()`;\r\n    }\r\n}\r\n\r\nexport class MatchAnyNumber implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = false;\r\n        if (_.isNumber(object))\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        return `It.isAnyNumber()`;\r\n    }\r\n}","import * as common from \"../Common/_all\";\r\nimport { IMatch } from \"./IMatch\";\r\nimport { Consts } from \"../Consts\";\r\n\r\nexport class MatchPred<T> implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    constructor(private readonly _pred: common.IFunc2<T, boolean>) {\r\n    }\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = false;\r\n        if (object && this._pred(<T>object))\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        let res = `It.is(${this._pred})`;\r\n        return res;\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport { IMatch } from \"./IMatch\";\r\nimport { Consts } from \"../Consts\";\r\nimport { Utils } from \"../Common/Utils\";\r\n\r\nexport class MatchValue<T> implements IMatch {\r\n\r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n\r\n    private readonly _value: T;\r\n\r\n    constructor(value: T) {\r\n        this._value = <any>_.cloneDeep(value);\r\n    }\r\n\r\n    ___matches(object: any): boolean {\r\n        let match = false;\r\n        if (_.isEqual(this._value, object))\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        let valueName = Utils.argsName(<any>[this._value]);\r\n        let res = `It.isValue(${valueName})`;\r\n        return res;\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport { IMatch } from \"./IMatch\";\r\nimport { Consts } from \"../Consts\";\r\nimport { Utils } from \"../Common/Utils\";\r\n\r\nexport class MatchObjectWith<T> implements IMatch {\r\n    \r\n    readonly ___id = Consts.IMATCH_ID_VALUE;\r\n    \r\n    private readonly _value: T;\r\n\r\n    constructor(value: T) {\r\n        this._value = <any>_.cloneDeep(value);\r\n    }\r\n\r\n    ___matches(object: Object): boolean {\r\n        let match = false;\r\n        let partial = _.pick(object, _.keys(this._value));\r\n        if (_.isEqual(this._value, partial))\r\n            match = true;\r\n        return match;\r\n    }\r\n\r\n    toString(): string {\r\n        let valueName = Utils.argsName(<any>[this._value]);\r\n        let res = `It.isObjectWith(${valueName})`;\r\n        return res;\r\n    }\r\n}\r\n","import * as _ from \"lodash\";\r\nimport * as common from \"../Common/_all\";\r\nimport { ICallContext, CallType, ProxyType } from \"./ICallContext\";\r\n\r\nexport enum InvocationType {\r\n    NONE, SETUP, EXECUTE\r\n}\r\n\r\nexport abstract class BaseInvocation implements ICallContext {\r\n    returnValue: any;\r\n    invocationType = InvocationType.NONE;\r\n\r\n    constructor(public readonly proxyType: ProxyType, public callType: CallType) {\r\n    }\r\n\r\n    abstract get args(): IArguments;\r\n    abstract set args(value: IArguments);\r\n\r\n    abstract get property(): IPropertyInfo;\r\n\r\n    abstract invokeBase(): void;\r\n\r\n    get isAnUnknownDynamicCallAtExecution(): boolean {\r\n        return this.proxyType == ProxyType.DYNAMIC &&\r\n            this.callType == CallType.UNKNOWN &&\r\n            this.invocationType == InvocationType.EXECUTE;\r\n    };\r\n}\r\n\r\nexport class MethodInvocation extends BaseInvocation {\r\n    private _args: IArguments;\r\n\r\n    constructor(\r\n        private readonly _that: Object,\r\n        private readonly _property: MethodInfo,\r\n        args?: IArguments,\r\n        proxyType = ProxyType.STATIC,\r\n        callType = CallType.FUNCTION) {\r\n\r\n        super(proxyType, callType);\r\n\r\n        if (args) {\r\n            this._args = <any>_.cloneDeep(args);\r\n            this._args.length = args.length;\r\n            this._args.callee = args.callee;\r\n        }\r\n    }\r\n\r\n    get args(): IArguments { return this._args || <any>{ length: 0, callee: null }; }\r\n    set args(value: IArguments) { this._args = value; }\r\n\r\n    get property(): IPropertyInfo { return this._property; }\r\n\r\n    invokeBase(): void {\r\n        let thatClone = {};\r\n        if (this._that)\r\n            common.Utils.clone(thatClone, this._that);\r\n        else\r\n            thatClone = this._property.obj;\r\n        this.returnValue = this._property.toFunc.apply(thatClone, this._args);\r\n    }\r\n\r\n    toString(): string {\r\n        const res = `${this.property}(${common.Utils.argsName(this.args)})`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class ValueGetterInvocation extends BaseInvocation {\r\n    constructor(\r\n        private readonly _property: IPropertyInfo,\r\n        readonly value: any,\r\n        proxyType = ProxyType.STATIC,\r\n        callType = CallType.PROPERTY) {\r\n\r\n        super(proxyType, callType);\r\n\r\n        this.returnValue = _.cloneDeep(value);\r\n    }\r\n\r\n    get args(): IArguments {\r\n        let args: any[] = [];\r\n        Object.defineProperty(args, \"callee\",\r\n            { configurable: true, enumerable: true, writable: false, value: null });\r\n        return <any>args;\r\n    }\r\n    set args(value: IArguments) { }\r\n\r\n    get property(): IPropertyInfo { return this._property; }\r\n\r\n    invokeBase(): void {\r\n        this.returnValue = (<any>this._property.obj)[this._property.name];\r\n    }\r\n\r\n    toString(): string {\r\n        const res = `${this.property}`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class DynamicGetInvocation extends ValueGetterInvocation {\r\n    constructor(\r\n        property: IPropertyInfo,\r\n        value: any) {\r\n\r\n        super(property, value, ProxyType.DYNAMIC, CallType.UNKNOWN);\r\n\r\n        this.returnValue = _.cloneDeep(value);\r\n    }\r\n}\r\n\r\nexport class ValueSetterInvocation extends BaseInvocation {\r\n    private _args: IArguments;\r\n\r\n    constructor(\r\n        private readonly _property: IPropertyInfo,\r\n        args: IArguments,\r\n        proxyType = ProxyType.STATIC,\r\n        callType = CallType.PROPERTY) {\r\n\r\n        super(proxyType, callType);\r\n\r\n        this._args = <any>_.cloneDeep(args);\r\n        this._args.length = args.length;\r\n        this._args.callee = args.callee;\r\n    }\r\n\r\n    get args(): IArguments { return this._args; }\r\n    set args(value: IArguments) { this._args = value; }\r\n\r\n    get property(): IPropertyInfo { return this._property; }\r\n\r\n    invokeBase(): void {\r\n        (<any>this._property.obj)[this._property.name] = this._args[0];\r\n        this.returnValue = (<any>this._property.obj)[this._property.name];\r\n    }\r\n\r\n    toString(): string {\r\n        const res = `${this.property} = ${common.Utils.argsName(this.args[0])}`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class MethodGetterInvocation extends BaseInvocation {\r\n    constructor(\r\n        private readonly _property: IPropertyInfo,\r\n        private readonly _getter: () => any,\r\n        proxyType = ProxyType.STATIC,\r\n        callType = CallType.FUNCTION) {\r\n\r\n        super(proxyType, callType);\r\n    }\r\n\r\n    get args(): IArguments {\r\n        let args: any[] = [];\r\n        Object.defineProperty(args, \"callee\",\r\n            { configurable: true, enumerable: true, writable: false, value: null });\r\n        return <any>args;\r\n    }\r\n    set args(value: IArguments) { }\r\n\r\n    get property(): IPropertyInfo { return this._property; }\r\n\r\n    invokeBase(): void {\r\n        this.returnValue = (<any>this._property.obj)[this._property.name];\r\n    }\r\n\r\n    toString(): string {\r\n        const res = `${this.property}`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class MethodSetterInvocation extends BaseInvocation {\r\n    private _args: IArguments;\r\n\r\n    constructor(\r\n        private readonly _property: IPropertyInfo,\r\n        private readonly _setter: (v: any) => void,\r\n        args: IArguments,\r\n        proxyType = ProxyType.STATIC,\r\n        callType = CallType.FUNCTION) {\r\n\r\n        super(proxyType, callType);\r\n\r\n        this._args = <any>_.cloneDeep(args);\r\n        this._args.length = args.length;\r\n        this._args.callee = args.callee;\r\n    }\r\n\r\n    get args(): IArguments { return this._args; }\r\n    set args(value: IArguments) { this._args = value; }\r\n\r\n    get property(): IPropertyInfo { return this._property; }\r\n\r\n    invokeBase(): void {\r\n        (<any>this._property.obj)[this._property.name] = this._args[0];\r\n        this.returnValue = (<any>this._property.obj)[this._property.name];\r\n    }\r\n\r\n    toString(): string {\r\n        const res = `${this.property}(${common.Utils.argsName(this.args[0])})`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class MethodInfo implements IPropertyInfo {\r\n    readonly desc: common.PropDescriptor;\r\n\r\n    constructor(\r\n        public readonly obj: any,\r\n        public readonly name: string,\r\n        desc?: common.PropDescriptor) {\r\n\r\n        if (desc)\r\n            this.desc = _.cloneDeep(desc);\r\n    }\r\n\r\n    get toFunc(): Function {\r\n        const func = _.isFunction(this.obj) ? <Function>this.obj : <Function>this.obj[this.name];\r\n        return func;\r\n    }\r\n\r\n    toString(): string {\r\n        const objName = common.Utils.objectName(this.obj);\r\n        const res = _.isFunction(this.obj) ? `${objName}` : `${objName}.${this.name}`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport class PropertyInfo implements IPropertyInfo {\r\n    readonly desc: common.PropDescriptor;\r\n\r\n    constructor(\r\n        public readonly obj: Object,\r\n        public readonly name: string,\r\n        desc?: common.PropDescriptor) {\r\n\r\n        if (desc)\r\n            this.desc = _.cloneDeep(desc);\r\n    }\r\n\r\n    toString(): string {\r\n        const objName = common.Utils.objectName(this.obj);\r\n        const res = `${objName}.${this.name}`;\r\n        return res;\r\n    }\r\n}\r\n\r\nexport interface IPropertyInfo {\r\n    obj: Object;\r\n    name: string;\r\n    desc?: common.PropDescriptor;\r\n}\r\n","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { CurrentInterceptContext } from \"./CurrentInterceptContext\";\r\n\r\nexport enum InterceptionAction { Continue, Stop }\r\n\r\nexport interface IInterceptStrategy<T> {\r\n\thandleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction;\r\n}\r\n\r\nexport class InterceptorContext<T> {\r\n\tprivate _actualInvocations: Array<all.ICallContext> = [];\r\n\tprivate _expectedCalls: Array<all.IProxyCall<T>> = [];\r\n\r\n\tconstructor(public mock: all.IMock<T>) { }\r\n\r\n\tget behavior(): all.MockBehavior { return this.mock.behavior; } \r\n\r\n\taddInvocation(invocation: all.ICallContext) { this._actualInvocations.push(invocation); }\r\n\tremoveInvocation(invocation: all.ICallContext) {\r\n\t\t_.remove(this._actualInvocations, (x: all.ICallContext): boolean => {\r\n\t\t\treturn x === invocation;\r\n\t\t});\r\n\t}\r\n\tactualInvocations(): all.ICallContext[] { return this._actualInvocations; }\r\n\tprivate clearInvocations() { this._actualInvocations.splice(0, this._actualInvocations.length); }\r\n\r\n\taddExpectedCall(call: all.IProxyCall<T>) { this._expectedCalls.push(call); }\r\n\tremoveExpectedCall(call: all.IProxyCall<T>) {\r\n\t\t_.filter(this._expectedCalls, (x: all.IProxyCall<T>): boolean => {\r\n\t\t\treturn x.id !== call.id;\r\n\t\t});\r\n\t}\r\n\texpectedCalls(): all.IProxyCall<T>[] { return this._expectedCalls; }\r\n\tprivate clearExpectedCalls() { this._expectedCalls.splice(0, this._expectedCalls.length); }\r\n\t\r\n\treset(): void {\r\n\t\tthis.clearInvocations();\r\n\t\tthis.clearExpectedCalls();\r\n\t}\r\n}","import * as _ from \"lodash\";\r\nimport * as common from \"../Common/_all\";\r\nimport * as error from \"../Error/_all\";\r\nimport { Consts } from \"../Consts\";\r\nimport { IProxy } from \"./IProxy\";\r\nimport { ICallContext } from \"./ICallContext\";\r\nimport { ICallInterceptor } from \"./ICallInterceptor\";\r\nimport { PropertyInfo, MethodInfo, MethodInvocation, MethodGetterInvocation, MethodSetterInvocation, ValueGetterInvocation, ValueSetterInvocation } from \"./Invocation\";\r\n\r\nexport class ProxyES5<T> implements IProxy {\r\n\r\n    readonly ___id = Consts.IPROXY_ID_VALUE;\r\n\r\n    private constructor(target: T, interceptor: ICallInterceptor) {\r\n        this.check(target);\r\n        let that = this;\r\n\r\n        let props = common.PropertyRetriever.getOwnAndPrototypeEnumerablesAndNonenumerables(target);\r\n        _.each(props, (prop: { name: string; desc: common.PropDescriptor }) => {\r\n\r\n            if (_.isFunction(prop.desc.value)) {\r\n                let propDesc: common.PropDescriptor = {\r\n                    configurable: prop.desc.configurable,\r\n                    enumerable: prop.desc.enumerable,\r\n                    writable: prop.desc.writable\r\n                };\r\n\r\n                this.defineMethodProxy(that, interceptor, target, prop.name, propDesc);\r\n            }\r\n            else {\r\n                let propDesc: common.PropDescriptor = {\r\n                    configurable: prop.desc.configurable,\r\n                    enumerable: prop.desc.enumerable\r\n                };\r\n\r\n                if (prop.desc.value !== undefined)\r\n                    this.defineValuePropertyProxy(that, interceptor, target, prop.name, prop.desc.value, propDesc);\r\n                else\r\n                    this.defineGetSetPropertyProxy(that, interceptor, target, prop.name, prop.desc.get, prop.desc.set, propDesc);\r\n            }\r\n\r\n        });\r\n    }\r\n\r\n    static of<U>(target: U, interceptor: ICallInterceptor): ProxyES5<U> {\r\n        ProxyES5.check(target);\r\n\r\n        let result: any;\r\n\r\n        if (_.isFunction(target)) {\r\n            let funcName = common.Utils.functionName(target);\r\n            result = ProxyES5.methodProxyValue(undefined, interceptor, target, funcName, null);\r\n        }\r\n        else {\r\n            result = new ProxyES5(target, interceptor);\r\n        }\r\n\r\n        return result;\r\n    }\r\n\r\n    static isProxy(obj: any): boolean {\r\n        if (!_.isNil(obj) &&\r\n            !_.isUndefined(obj[Consts.IPROXY_ID_NAME]) && obj[Consts.IPROXY_ID_NAME] === Consts.IPROXY_ID_VALUE)\r\n            return true;\r\n        else\r\n            return false;\r\n    }\r\n\r\n    private static check<U>(target: U): void {\r\n        ProxyES5.checkNotNullOrUndefined(target);\r\n\r\n        // allow only primitive objects and functions\r\n        let ok = false;\r\n        if (_.isFunction(target) ||\r\n            (_.isObject(target) && !ProxyES5.isPrimitiveObject(target)))\r\n            ok = true;\r\n\r\n        if (!ok)\r\n            throw new error.MockException(error.MockExceptionReason.InvalidArg,\r\n                target, `'${target}'; proxy argument should be a function or a non primitive object`);\r\n    }\r\n\r\n    private check<U>(target: U): void {\r\n        ProxyES5.checkNotNullOrUndefined(target);\r\n\r\n        // allow only non primitive objects\r\n        let ok = false;\r\n        if (!_.isFunction(target) &&\r\n            (_.isObject(target) && !ProxyES5.isPrimitiveObject(target)))\r\n            ok = true;\r\n\r\n        if (!ok)\r\n            throw new error.MockException(error.MockExceptionReason.InvalidArg,\r\n                target, `'${target}'; proxy argument should be a non primitive object`);\r\n    }\r\n\r\n    private static checkNotNullOrUndefined<U>(instance: U): void {\r\n        if (_.isNil(instance))\r\n            throw new error.MockException(error.MockExceptionReason.InvalidArg,\r\n                instance, `'${instance}'; proxy argument is required`);\r\n    }\r\n\r\n    private static isPrimitiveObject(obj: Object): boolean {\r\n        let result = false;\r\n\r\n        if (_.isFunction(obj) ||\r\n            _.isArray(obj) ||\r\n            _.isDate(obj) ||\r\n            _.isNull(obj))\r\n            result = true;\r\n\r\n        return result;\r\n    }\r\n\r\n    private defineMethodProxy(\r\n        that: Object,\r\n        interceptor: ICallInterceptor,\r\n        target: T,\r\n        propName: string,\r\n        propDesc: common.PropDescriptor = { configurable: true, enumerable: true, writable: false }) {\r\n\r\n        propDesc.value = ProxyES5.methodProxyValue(that, interceptor, target, propName, propDesc);\r\n\r\n        this.defineProperty(that, propName, propDesc);\r\n    }\r\n\r\n    private static methodProxyValue<U>(\r\n        that: Object,\r\n        interceptor: ICallInterceptor,\r\n        target: U,\r\n        propName: string,\r\n        propDesc: common.PropDescriptor): () => any {\r\n\r\n        function proxy() {\r\n            let method = new MethodInfo(target, propName, propDesc);\r\n            let invocation: ICallContext = new MethodInvocation(that, method, arguments);\r\n            interceptor.intercept(invocation);\r\n            return invocation.returnValue;\r\n        }\r\n        return proxy;\r\n    }\r\n\r\n    private defineValuePropertyProxy(\r\n        that: Object,\r\n        interceptor: ICallInterceptor,\r\n        target: T,\r\n        propName: string,\r\n        propValue: any,\r\n        propDesc: common.PropDescriptor = { configurable: true, enumerable: true }) {\r\n\r\n        function getProxy(): any {\r\n            let method = new PropertyInfo(target, propName);\r\n            let invocation: ICallContext = new ValueGetterInvocation(method, propValue);\r\n            interceptor.intercept(invocation);\r\n            return invocation.returnValue;\r\n        }\r\n        propDesc.get = getProxy;\r\n\r\n        function setProxy(v: any): void {\r\n            let method = new PropertyInfo(target, propName);\r\n            let invocation: ICallContext = new ValueSetterInvocation(method, arguments);\r\n            interceptor.intercept(invocation);\r\n        }\r\n        propDesc.set = setProxy;\r\n\r\n        this.defineProperty(that, propName, propDesc);\r\n    }\r\n\r\n    private defineGetSetPropertyProxy(\r\n        that: Object,\r\n        interceptor: ICallInterceptor,\r\n        target: T,\r\n        propName: string,\r\n        get?: () => any,\r\n        set?: (v: any) => void,\r\n        propDesc: common.PropDescriptor = { configurable: true, enumerable: true }) {\r\n\r\n        function getProxy(): any {\r\n            let method = new PropertyInfo(target, propName);\r\n            let invocation: ICallContext = new MethodGetterInvocation(method, get);\r\n            interceptor.intercept(invocation);\r\n            return invocation.returnValue;\r\n        }\r\n        propDesc.get = getProxy;\r\n\r\n        function setProxy(v: any): void {\r\n            let method = new PropertyInfo(target, propName);\r\n            let invocation: ICallContext = new MethodSetterInvocation(method, set, arguments);\r\n            interceptor.intercept(invocation);\r\n        }\r\n        propDesc.set = setProxy;\r\n\r\n        this.defineProperty(that, propName, propDesc);\r\n    }\r\n\r\n    private defineProperty(obj: Object, name: string, desc: common.PropDescriptor) {\r\n        try {\r\n            Object.defineProperty(obj, name, desc);\r\n        }\r\n        catch (e) {\r\n            console.log(e.message);\r\n        }\r\n    }\r\n}","///<reference path=\"../../node_modules/typescript/lib/lib.es6.d.ts\"/>\r\nimport * as error from \"../Error/_all\";\r\nimport { Consts } from \"../Consts\";\r\nimport { IProxy } from \"./IProxy\";\r\nimport { IProxyHandler, PropKey } from \"./IProxyHandler\";\r\n\r\nexport class ProxyES6<T> implements IProxy {\r\n\r\n    readonly ___id = Consts.IPROXY_ID_VALUE;\r\n\r\n    private constructor(target: T, handler: IProxyHandler<T>) {\r\n        const p = <ProxyES6<T>>new Proxy(<Object>target, handler);\r\n        (<any>p)[Symbol.toStringTag] = Function.prototype.toString.bind(target);\r\n        return p;\r\n    }\r\n\r\n    static of<U>(target: U, handler: IProxyHandler<U>): ProxyES6<U> {\r\n        ProxyES6.check();\r\n        const result = new ProxyES6(target, handler);\r\n        return result;\r\n    }\r\n\r\n    private static check(): void {\r\n        if (typeof Proxy === \"undefined\")\r\n            throw new error.MockException(error.MockExceptionReason.InvalidDynamicProxyRuntime,\r\n                null, \"ES6 Proxy object not detected; the dynamic mocking feature requires ES6 Proxy object support\");\r\n    }\r\n}\r\n","import * as common from \"../Common/_all\";\r\nimport { ICallContext, ProxyType, CallType } from \"./ICallContext\";\r\nimport { ICallInterceptor } from \"./ICallInterceptor\";\r\nimport * as inv from \"./Invocation\";\r\nimport { IProxyHandler, PropKey } from \"./IProxyHandler\";\r\n\r\nexport class ProxyES6Handler<T> implements IProxyHandler<T> {\r\n\r\n    constructor(private readonly _interceptor: ICallInterceptor) {\r\n    }\r\n\r\n    apply(target: T, thisArg: any, argArray?: any): any {\r\n\r\n        const funcName = common.Utils.functionName(target);\r\n        const method = new inv.MethodInfo(target, funcName);\r\n        const invocation: ICallContext = new inv.MethodInvocation(target, method, argArray, ProxyType.DYNAMIC);\r\n        this._interceptor.intercept(invocation);\r\n\r\n        return invocation.returnValue;\r\n    }\r\n\r\n    get(target: T, p: PropKey, receiver: any): any {\r\n\r\n        if (p !== Symbol.toStringTag &&\r\n            p !== Symbol.toPrimitive &&\r\n            p !== \"toJSON\") {\r\n\r\n            const propValue = (<any>target)[p];\r\n            const method = new inv.PropertyInfo(target, <string>p);\r\n            const invocation = new inv.DynamicGetInvocation(method, propValue);\r\n\r\n            this._interceptor.intercept(invocation);\r\n\r\n            if (invocation.callType == CallType.PROPERTY &&\r\n                invocation.property.desc) // value getter invocation at execution time\r\n\r\n                return invocation.returnValue;\r\n            else\r\n                return (...args: any[]) => {\r\n\r\n                    this._interceptor.removeInvocation(invocation);\r\n\r\n                    const method = new inv.MethodInfo(target, <string>p);\r\n                    const methodInvocation = new inv.MethodInvocation(target, method, <any>args, ProxyType.DYNAMIC);\r\n                    this._interceptor.intercept(methodInvocation);\r\n\r\n                    return methodInvocation.returnValue;\r\n                }\r\n        }\r\n        else\r\n            return Reflect.get(<Object>target, p, receiver);\r\n    }\r\n\r\n    set(target: T, p: PropKey, value: any, receiver: any): boolean {\r\n\r\n        if (p !== Symbol.toStringTag) {\r\n\r\n            const method = new inv.PropertyInfo(target, <string>p);\r\n            const invocation: ICallContext = new inv.ValueSetterInvocation(method, <any>[value], ProxyType.DYNAMIC);\r\n            this._interceptor.intercept(invocation);\r\n        }\r\n\r\n        return Reflect.set(<Object>target, p, value, receiver);\r\n    }\r\n\r\n    defineProperty(target: T, p: PropKey, attributes: common.PropDescriptor): boolean {\r\n\r\n        attributes.configurable = true;\r\n\r\n        return Reflect.defineProperty(<Object>target, p, attributes);\r\n    }\r\n\r\n}\r\n","import { ICallInterceptor } from \"./ICallInterceptor\";\r\nimport { ProxyES5 } from \"./ProxyES5\";\r\nimport { ProxyES6 } from \"./ProxyES6\";\r\nimport { ProxyES6Handler } from \"./ProxyES6Handler\";\r\n\r\nexport class ProxyFactory {\r\n    \r\n    static createProxy<T>(target: T, interceptor: ICallInterceptor): T {\r\n        let proxy: T = <T><any>ProxyES5.of(target, interceptor);\r\n        return proxy;\r\n    }\r\n\r\n    static createProxyES6<T>(target: T, interceptor: ICallInterceptor): T {\r\n        let proxyHandler: ProxyES6Handler<T> = new ProxyES6Handler(interceptor);\r\n        let proxy: T = <T><any>ProxyES6.of(target, proxyHandler);\r\n        return proxy;\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { InterceptorExecute } from \"./InterceptorExecute\";\r\nimport { MethodCall } from \"./MethodCall\";\r\nimport { MethodCallReturn } from \"./MethodCallReturn\";\r\n\r\nexport abstract class MockBase<T> implements all.IMock<T> {\r\n\r\n    private _id: string;\r\n    protected _name: string;\r\n    protected _interceptor: InterceptorExecute<T>;\r\n    protected _proxy: T;\r\n    private _callBase: boolean;\r\n\r\n    constructor(\r\n        public readonly target: T,\r\n        public readonly canOverrideTarget: boolean,\r\n        public readonly behavior: all.MockBehavior = all.MockBehavior.Loose) {\r\n        \r\n        this._id = this.generateId();\r\n        this._name = this.getNameOf(this.target);\r\n    }\r\n\r\n    get object() { return this._proxy; }\r\n    get name() { return this._name; }\r\n\r\n    get callBase() { return this._callBase; }\r\n    set callBase(value: boolean) { this._callBase = value; }\r\n\r\n    private generateId() {\r\n        return \"Mock<\" + _.uniqueId() + \">\";\r\n    }\r\n\r\n    private getNameOf(instance: T): string {\r\n        let result: string;\r\n\r\n        if (_.isFunction(instance)) {\r\n            result = all.Utils.functionName(instance);\r\n        }\r\n        else if (_.isObject(instance)) {\r\n            let ctor = instance.constructor;\r\n            result = all.Utils.functionName(ctor);\r\n        }\r\n\r\n        if (result)\r\n            result = result.trim();\r\n\r\n        return result;\r\n    }\r\n\r\n    // setup\r\n\r\n    abstract setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult>;\r\n\r\n    // verify\r\n\r\n    abstract verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void;\r\n\r\n    verifyAll(): void {\r\n        try {\r\n            this._interceptor.verify();\r\n        }\r\n        catch (e) {\r\n            throw e;\r\n        }\r\n    }\r\n\r\n    // reset\r\n\r\n    reset(): void {\r\n        this._interceptor.reset();\r\n    }\r\n\r\n}","import * as all from \"./_all\";\r\nimport { MockBehavior } from \"./_all\";\r\nimport { MethodCallReturn } from \"./MethodCallReturn\";\r\n\r\nexport enum GlobalType { Class, Function, Value }\r\n\r\nexport class GlobalMock<T> implements all.IGlobalMock<T> {\r\n\r\n    constructor(public mock: all.IMock<T>, private _name: string, private _type: GlobalType, public container: Object) {\r\n        if (!this._name)\r\n            this._name = mock.name;\r\n    }\r\n\r\n    get object() { return this.mock.object; }\r\n    get target() { return this.mock.target; }\r\n\r\n    get name() { return this._name || this.mock.name; }\r\n    get behavior() { return this.mock.behavior; }\r\n\r\n    get callBase() { return this.mock.callBase; }\r\n    set callBase(value: boolean) { this.mock.callBase = value; }\r\n\r\n    get type() { return this._type; }\r\n\r\n    // setup\r\n\r\n    setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult> {\r\n        return this.mock.setup(expression);\r\n    }\r\n\r\n    // verify\r\n\r\n    verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void {\r\n        this.mock.verify(expression, times);\r\n    }\r\n\r\n    verifyAll(): void {\r\n        this.mock.verifyAll();\r\n    }\r\n\r\n    reset(): void {\r\n        this.mock.reset();\r\n    }\r\n}","import * as all from \"./_all\";\r\n\r\nexport class CurrentInterceptContext<T> {\r\n    call: all.IProxyCall<T>;\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { InterceptorContext, IInterceptStrategy, InterceptionAction } from \"./InterceptorContext\";\r\nimport { CurrentInterceptContext } from \"./CurrentInterceptContext\";\r\n\r\nexport class AddActualInvocation<T> implements IInterceptStrategy<T> {\r\n\r\n    handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction {\r\n        ctx.addInvocation(invocation);\r\n        return InterceptionAction.Continue;\r\n    }\r\n}\r\n\r\nexport class ExtractProxyCall<T> implements IInterceptStrategy<T> {\r\n\r\n    handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction {\r\n        let expectedCalls = ctx.expectedCalls().slice();\r\n\r\n        let findCallPred = <T>(c: all.IProxyCall<T>) => c.matches(invocation);\r\n\r\n        let matchingCalls = _.filter(expectedCalls, (c: all.IProxyCall<T>) => {\r\n            return findCallPred(c);\r\n        });\r\n\r\n        if (matchingCalls.length > 1)   // record/replay scenario \r\n            findCallPred = <T>(c: all.IProxyCall<T>) => !c.isInvoked &&\r\n                c.matches(invocation);\r\n\r\n        localCtx.call = _.find(expectedCalls, (c: all.IProxyCall<T>) => {\r\n            return findCallPred(c);\r\n        });\r\n        \r\n        if (localCtx.call != null) {\r\n            // determine call type for dynamic mock at execution\r\n            if (invocation.isAnUnknownDynamicCallAtExecution) {\r\n                \r\n                invocation.callType = localCtx.call.setupCall.callType;\r\n                \r\n                if (invocation.callType == all.CallType.FUNCTION)\r\n                    return InterceptionAction.Stop; // avoid executing twice any existing setups\r\n            }\r\n\r\n            localCtx.call.evaluatedSuccessfully();\r\n        }\r\n        else if (ctx.behavior == all.MockBehavior.Strict)\r\n                throw new all.MockException(all.MockExceptionReason.NoSetup, invocation, `'${invocation}'`);\r\n\r\n        return InterceptionAction.Continue;\r\n    }\r\n}\r\n\r\nexport class ExecuteCall<T> implements IInterceptStrategy<T> {\r\n\r\n    private _ctx: InterceptorContext<T>;\r\n\r\n    handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction {\r\n        this._ctx = ctx;\r\n        let currentCall = localCtx.call;\r\n\r\n        if (currentCall != null) {\r\n            currentCall.execute(invocation);\r\n            return InterceptionAction.Stop;\r\n        }\r\n\r\n        return InterceptionAction.Continue;\r\n    }\r\n\r\n}\r\n\r\nexport class InvokeBase<T> implements IInterceptStrategy<T> {\r\n\r\n    handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction {\r\n        if (ctx.mock.callBase) {\r\n            invocation.invokeBase();\r\n            return InterceptionAction.Stop;\r\n        }\r\n        return InterceptionAction.Continue;\r\n    }\r\n}\r\n\r\nexport class HandleMockRecursion<T> implements IInterceptStrategy<T> {\r\n\r\n    handleIntercept(invocation: all.ICallContext, ctx: InterceptorContext<T>, localCtx: CurrentInterceptContext<T>): InterceptionAction {\r\n        //TODO: \r\n        return InterceptionAction.Continue;\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { InterceptorContext, IInterceptStrategy, InterceptionAction } from \"./InterceptorContext\";\r\nimport { CurrentInterceptContext } from \"./CurrentInterceptContext\";\r\nimport * as strategy from \"./InterceptorStrategies\";\r\n\r\nexport class InterceptorExecute<T> implements all.ICallInterceptor {\r\n    private _interceptorContext: InterceptorContext<T>;\r\n\r\n    constructor(mock: all.IMock<T>) {\r\n        this._interceptorContext = new InterceptorContext(mock);\r\n    }\r\n\r\n    get interceptorContext(): InterceptorContext<T> { return this._interceptorContext; }\r\n\r\n    intercept(invocation: all.ICallContext) {\r\n        let localCtx = new CurrentInterceptContext();\r\n\r\n        invocation.invocationType = all.InvocationType.EXECUTE;\r\n\r\n        _.some(this.interceptionStrategies(), (strategy: IInterceptStrategy<T>) => {\r\n            if (InterceptionAction.Stop === strategy.handleIntercept(invocation, this.interceptorContext, localCtx)) {\r\n                return true;\r\n            }\r\n        });\r\n    }\r\n\r\n    removeInvocation(invocation: all.ICallContext) {\r\n        this._interceptorContext.removeInvocation(invocation);\r\n    }\r\n\r\n    addExpectedCall(call: all.IProxyCall<T>): void {\r\n        this._interceptorContext.addExpectedCall(call);\r\n    }\r\n\r\n    verify(): void {\r\n        let expectedCalls = this._interceptorContext.expectedCalls();\r\n\r\n        let verifiableCalls: Array<all.IProxyCall<T>> = [];\r\n        if (this._interceptorContext.behavior == all.MockBehavior.Strict) { // verifiable by default when strict mocking\r\n            for (let call of expectedCalls) {\r\n                if (!call.isVerifiable)\r\n                    call.setVerifiable();\r\n                verifiableCalls.push(call);\r\n            }\r\n        }\r\n        else {\r\n            verifiableCalls = _.filter(expectedCalls, (c: all.IProxyCall<T>) => c.isVerifiable);\r\n        }\r\n        for (let v of verifiableCalls)\r\n            this.verifyCallCount(v, v.expectedCallCount);\r\n\r\n        let orderedCalls: Array<all.IProxyCall<T>> = _.filter(expectedCalls, (c: all.IProxyCall<T>) => c.isInSequence);\r\n        this.verifyCallsOrder(orderedCalls);\r\n    }\r\n\r\n    verifyCallCount<T>(call: all.IProxyCall<T>, times: all.Times): void {\r\n        let expectedCalls = this._interceptorContext.expectedCalls();\r\n        let actualCalls = this._interceptorContext.actualInvocations();\r\n\r\n        let callCount: number = _.filter(actualCalls, (c: all.ICallContext) => call.matches(c)).length;\r\n\r\n        if (!times.verify(callCount))\r\n            this.throwVerifyCallCountException(call.setupCall, times, expectedCalls, actualCalls);\r\n    }\r\n\r\n    private throwVerifyCallCountException(setupCall: all.ICallContext, times: all.Times,\r\n        expectedCalls: Array<all.IProxyCall<T>>, actualCalls: Array<all.ICallContext>) {\r\n\r\n        let failMsg = times.failMessage(setupCall);\r\n        let expectedCallsMsg = expectedCalls.reduce((a, x) => `${a} ${x}\\n`, \"\");\r\n        let actualCallsMsg = actualCalls.reduce((a, x) => `${a} ${x}\\n`, \"\");\r\n        let msg = `${failMsg}\\n Configured setups:\\n${expectedCallsMsg}\\n Performed invocations:\\n${actualCallsMsg}`;\r\n\r\n        let e = new all.MockException(all.MockExceptionReason.CallCountVerificationFailed, setupCall, msg);\r\n        throw e;\r\n    }\r\n\r\n    private verifyCallsOrder<T>(expectedCalls: Array<all.IProxyCall<T>>): void {\r\n        let actualCalls = this._interceptorContext.actualInvocations();\r\n\r\n        this.checkCallOrderExpectations(expectedCalls, actualCalls);\r\n    }\r\n\r\n    private checkCallOrderExpectations<T>(expectedCalls: Array<all.IProxyCall<T>>, actualCalls: Array<all.ICallContext>): void {\r\n        let checkOrder = (expectedCallCountList: Array<number>): boolean => {\r\n            let expectedCallCount = _.sum(expectedCallCountList);\r\n            let aci = 0;\r\n            for (let eci = 0; eci < expectedCallCountList.length; eci++) {\r\n                let expectedCall = expectedCalls[eci];\r\n                let expectedCallCount = expectedCallCountList[eci];\r\n                for (let count = 1; count <= expectedCallCount; count++) {\r\n                    let actualCall = actualCalls[aci++];\r\n                    if (!expectedCall.matches(actualCall))\r\n                        return false;\r\n                }\r\n            }\r\n            return aci === expectedCallCount;\r\n        }\r\n\r\n        let eureka = false;\r\n        let execute = (acc: Array<number>, i: number) => {\r\n            if (!eureka) {\r\n                if (i === expectedCalls.length)\r\n                    eureka = checkOrder(acc);\r\n                else\r\n                    for (let j = expectedCalls[i].expectedCallCount.min; j <= expectedCalls[i].expectedCallCount.max; j++) {\r\n                        acc[i] = j;\r\n                        execute(acc, i + 1);\r\n                    }\r\n            }\r\n        }\r\n        execute([], 0);\r\n\r\n        if (!eureka)\r\n            this.throwVerifyCallOrderException();\r\n    }\r\n\r\n    private throwVerifyCallOrderException() {\r\n        let e = new all.MockException(all.MockExceptionReason.CallOrderVerificationFailed, null);\r\n        throw e;\r\n    }\r\n\r\n    reset(): void {\r\n        this._interceptorContext.reset();\r\n    }\r\n\r\n    private interceptionStrategies(): _.List<IInterceptStrategy<T>> {\r\n        let strategies: _.List<IInterceptStrategy<T>> = [\r\n            new strategy.AddActualInvocation(),\r\n            new strategy.ExtractProxyCall(),\r\n            new strategy.ExecuteCall(),\r\n            new strategy.InvokeBase(),\r\n            new strategy.HandleMockRecursion()\r\n        ];\r\n        return strategies;\r\n    }\r\n\r\n}","import * as all from \"./_all\";\r\n\r\nexport class InterceptorSetup<T> implements all.ICallInterceptor {\r\n    private _interceptedCall: all.ICallContext;\r\n\r\n    get interceptedCall(): all.ICallContext { return this._interceptedCall; }\r\n\r\n    intercept(invocation: all.ICallContext) {\r\n        invocation.invocationType = all.InvocationType.SETUP;\r\n        \r\n        if (invocation.proxyType == all.ProxyType.DYNAMIC &&\r\n            invocation.callType == all.CallType.UNKNOWN)\r\n            invocation.callType = all.CallType.PROPERTY;\r\n\r\n        if (this._interceptedCall) {\r\n            throw new all.MockException(all.MockExceptionReason.MoreThanOneSetup,\r\n                invocation, `'${invocation}'; setup should contain only one expression`);\r\n        }\r\n\r\n        this._interceptedCall = invocation;\r\n    }\r\n\r\n    removeInvocation(invocation: all.ICallContext) {\r\n        if(this._interceptedCall && \r\n            this._interceptedCall === invocation)\r\n                this._interceptedCall = undefined;\r\n    }\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { MockBase } from \"./MockBase\";\r\nimport { InterceptorSetup } from \"./InterceptorSetup\";\r\nimport { Consts } from \"./Consts\";\r\n\r\nexport class MethodCall<T, TResult> implements all.IProxyCall<T>, all.IVerifies {\r\n\r\n    protected _id: string;\r\n    protected _setupCall: all.ICallContext;\r\n    protected _setupCallback: all.IAction;\r\n    protected _isVerifiable: boolean;\r\n    protected _expectedCallCount: all.Times;\r\n    protected _expectedCallType: all.ExpectedCallType;\r\n    protected _isInvoked: boolean;\r\n    protected _callCount: number = 0;\r\n    protected _thrownException: Error;\r\n    protected _evaluatedSuccessfully: boolean;\r\n\r\n    protected constructor(\r\n        public mock: MockBase<T>,\r\n        private _setupExpression: all.IFunc2<T, TResult>,\r\n        interceptor: InterceptorSetup<T>,\r\n        proxy: T) {\r\n\r\n        this._id = this.generateId();\r\n\r\n        _setupExpression(proxy);\r\n\r\n        if (interceptor.interceptedCall) {\r\n            let ic = interceptor.interceptedCall;\r\n\r\n            let newArgs = this.transformToMatchers(ic.args);\r\n            Object.defineProperty(newArgs, \"callee\",\r\n                { configurable: true, enumerable: true, writable: false, value: ic.args.callee });\r\n            ic.args = <IArguments><any>newArgs;\r\n\r\n            this._setupCall = ic;\r\n        }\r\n        else {\r\n            throw new all.MockException(all.MockExceptionReason.InvalidSetup,\r\n                this._setupExpression, `'${this._setupExpression}'`);\r\n        }\r\n    }\r\n\r\n    static ofStaticMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>) {\r\n        let interceptor = new InterceptorSetup<U>();\r\n        let proxy = all.ProxyFactory.createProxy<U>(mock.target, interceptor);\r\n        let result = new MethodCall(mock, setupExpression, interceptor, proxy);\r\n        return result;\r\n    }\r\n\r\n    static ofDynamicMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>) {\r\n        let interceptor = new InterceptorSetup<U>();\r\n        let proxy = all.ProxyFactory.createProxyES6<U>(mock.target, interceptor);\r\n        let result = new MethodCall(mock, setupExpression, interceptor, proxy);\r\n        return result;\r\n    }\r\n\r\n    private generateId() {\r\n        return \"MethodCall<\" + _.uniqueId() + \">\";\r\n    }\r\n\r\n    private transformToMatchers(args: IArguments): Array<all.IMatch> {\r\n        let newArgs: Array<all.IMatch> = [];\r\n\r\n        _.each(args, (a: any) => {\r\n            if (!_.isObject(a)) {\r\n                let newArg = new all.MatchValue(a);\r\n                newArgs.push(newArg);\r\n            }\r\n            else {\r\n                if (all.Match.isMatcher(a)) {\r\n                    newArgs.push(<all.IMatch>a);\r\n                }\r\n                else {\r\n                    // assume strict equality, short form of It.is(x => _.isEqual(x, a))\r\n                    let newArg = new all.MatchPred(x => _.isEqual(x, a));\r\n                    newArgs.push(newArg);\r\n                }\r\n            }\r\n        });\r\n\r\n        return newArgs;\r\n    }\r\n\r\n    // IProxyCall\r\n\r\n    get id(): string { return this._id; }\r\n    get setupExpression(): all.IAction1<T> { return this._setupExpression; }\r\n    get setupCall(): all.ICallContext { return this._setupCall; }\r\n    get isVerifiable(): boolean { return this._isVerifiable; }\r\n    get isInSequence(): boolean { return this._expectedCallType === all.ExpectedCallType.InSequence; }\r\n    get expectedCallCount(): all.Times { return this._expectedCallCount; }\r\n    get isInvoked(): boolean { return this._isInvoked; }\r\n    get callCount(): number { return this._callCount; }\r\n\r\n    setVerifiable(\r\n        times: all.Times = all.Times.once(),\r\n        expectedCallType: all.ExpectedCallType = all.ExpectedCallType.InAnyOrder): void {\r\n\r\n        this._isVerifiable = true;\r\n        this._expectedCallCount = times;\r\n        this._expectedCallType = expectedCallType;\r\n    }\r\n\r\n    evaluatedSuccessfully() {\r\n        this._evaluatedSuccessfully = true;\r\n    }\r\n\r\n    matches(call: all.ICallContext): boolean {\r\n        let match = false;\r\n\r\n        if (this._setupCall.property && call && call.property &&\r\n            this._setupCall.property.name === call.property.name) {\r\n\r\n            if (this._setupCall.args.length >= call.args.length) {\r\n                match = true;\r\n\r\n                if (!call.isAnUnknownDynamicCallAtExecution) {\r\n\r\n                    _.each(this._setupCall.args, (x: any, index: number) => {\r\n                        let setupArg = <all.IMatch>x;\r\n                        let callArg = call.args[index];\r\n\r\n                        if (match && !setupArg.___matches(callArg))\r\n                            match = false;\r\n                    });\r\n                }\r\n            }\r\n        }\r\n\r\n        return match;\r\n    }\r\n\r\n    execute(call: all.ICallContext): void {\r\n        this._isInvoked = true;\r\n\r\n        if (this._setupCallback != null) {\r\n            this._setupCallback.apply(this, call.args);\r\n        }\r\n\r\n        if (this._thrownException != null) {\r\n            throw this._thrownException;\r\n        }\r\n\r\n        this._callCount++;\r\n    }\r\n\r\n    // IVerifies\r\n\r\n    verifiable(\r\n        times?: all.Times,\r\n        expectedCallType?: all.ExpectedCallType): void {\r\n\r\n        this.setVerifiable(times, expectedCallType);\r\n    }\r\n\r\n    toString(): string {\r\n        let res = `${this.setupCall}`;\r\n        if (this.expectedCallCount)\r\n            res = `${res}, ${this.expectedCallCount}`;\r\n        return res;\r\n    }\r\n\r\n}\r\n","import * as all from \"./_all\";\r\nimport { MockBase } from \"./MockBase\";\r\nimport { InterceptorSetup } from \"./InterceptorSetup\";\r\nimport { MethodCall } from \"./MethodCall\";\r\n\r\nexport class MethodCallReturn<T, TResult> extends MethodCall<T, TResult> implements all.ISetup<T, TResult>, all.IReturnsResult<T> {\r\n\r\n    protected _returnValueFunc: all.IFuncN<any, TResult>;\r\n    hasReturnValue: boolean;\r\n    protected _callBase: boolean;\r\n    private readonly _overrideTarget: boolean;\r\n\r\n    private constructor(\r\n        mock: MockBase<T>,\r\n        setupExpression: all.IFunc2<T, TResult>,\r\n        interceptor: InterceptorSetup<T>,\r\n        proxy: T) {\r\n\r\n        super(mock, setupExpression, interceptor, proxy);\r\n\r\n        this._overrideTarget = mock.canOverrideTarget;\r\n    }\r\n\r\n    static ofStaticMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>) {\r\n        let interceptor = new InterceptorSetup<U>();\r\n        let proxy = all.ProxyFactory.createProxy<U>(mock.target, interceptor);\r\n        let result = new MethodCallReturn(mock, setupExpression, interceptor, proxy);\r\n        return result;\r\n    }\r\n\r\n    static ofDynamicMock<U, UResult>(mock: MockBase<U>, setupExpression: all.IFunc2<U, UResult>) {\r\n        let interceptor = new InterceptorSetup<U>();\r\n        let proxy = all.ProxyFactory.createProxyES6<U>(mock.target, interceptor);\r\n        let result = new MethodCallReturn(mock, setupExpression, interceptor, proxy);\r\n        return result;\r\n    }\r\n\r\n    // overrides\r\n\r\n    execute(call: all.ICallContext): void {\r\n        super.execute(call);\r\n\r\n        if (this._callBase)\r\n            call.invokeBase();\r\n        else if (this.hasReturnValue) {\r\n            call.returnValue = this._returnValueFunc.apply(this, call.args);\r\n            // help ProxyES6 identify value getter invocation at execution time\r\n            call.property.desc = { value: this.setupCall.property.desc && this.setupCall.property.desc.value };\r\n        }\r\n    }\r\n\r\n    // ISetup\r\n\r\n    callback(action: all.IActionN<any>): all.IReturnsThrows<T, TResult> {\r\n        this._setupCallback = action;\r\n        return this;\r\n    }\r\n\r\n    throws(exception: Error): all.IThrowsResult {\r\n        this._thrownException = exception;\r\n        return this;\r\n    }\r\n\r\n    returns(valueFunc: all.IFuncN<any, TResult>): all.IReturnsResult<T> {\r\n        this._returnValueFunc = valueFunc;\r\n        this.hasReturnValue = true;\r\n\r\n        // override target\r\n        if (this._overrideTarget) {\r\n            let obj: Object = this.mock.target;\r\n            let name: string = this.setupCall.property.name;\r\n            let desc: all.PropDescriptor = this.setupCall.property.desc;\r\n\r\n            if (!desc &&\r\n                this.setupCall.proxyType == all.ProxyType.DYNAMIC) {\r\n                // enable target property enumeration for dynamic mocks\r\n                desc = {};\r\n                desc.configurable = true;\r\n                desc.enumerable = true;\r\n\r\n                if (this.setupCall.callType == all.CallType.FUNCTION)\r\n                    desc.value = this._returnValueFunc;\r\n                else\r\n                    desc.get = this._returnValueFunc;\r\n\r\n                Object.defineProperty(obj, name, desc);\r\n            }\r\n            else if (desc) {\r\n                desc.configurable = true;\r\n                desc.enumerable = true;\r\n                desc.value = this._returnValueFunc;\r\n                Object.defineProperty(obj, name, desc);\r\n            }\r\n        }\r\n\r\n        return this;\r\n    }\r\n\r\n    callBase(): all.IReturnsResult<T> {\r\n        this._callBase = true;\r\n        return this;\r\n    }\r\n\r\n    // IReturnsResult\r\n\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { MockBase } from \"./MockBase\";\r\nimport { MockBehavior } from \"./_all\";\r\nimport { InterceptorExecute } from \"./InterceptorExecute\";\r\nimport { MethodCall } from \"./MethodCall\";\r\nimport { MethodCallReturn } from \"./MethodCallReturn\";\r\n\r\nexport class StaticMock<T> extends MockBase<T> {\r\n\r\n    private constructor(\r\n        target: T,\r\n        canOverrideTarget: boolean,\r\n        behavior: all.MockBehavior) {\r\n\r\n        super(target, canOverrideTarget, behavior);\r\n\r\n        this._interceptor = new InterceptorExecute(this);\r\n        this._proxy = all.ProxyFactory.createProxy<T>(target, this._interceptor);\r\n    }\r\n\r\n    static ofInstance<U>(targetInstance: U, behavior: all.MockBehavior, shouldOverrideTarget: boolean): all.IMock<U> {\r\n        targetInstance = StaticMock.cloneDeep(targetInstance);\r\n        const mock: StaticMock<U> = new StaticMock(targetInstance, shouldOverrideTarget, behavior);\r\n        return mock;\r\n    }\r\n\r\n    static ofGlobalInstance<U>(targetInstance: U, behavior: all.MockBehavior): all.IMock<U> {\r\n        const mock: StaticMock<U> = new StaticMock(targetInstance, false, behavior);\r\n        return mock;\r\n    }\r\n\r\n    static ofType<U>(targetConstructor: all.CtorWithArgs<U>, behavior: all.MockBehavior, shouldOverrideTarget: boolean, targetConstructorArgs: any[]): all.IMock<U> {\r\n        const targetInstance: U = all.Utils.conthunktor(targetConstructor, targetConstructorArgs);\r\n        const mock: StaticMock<U> = new StaticMock(targetInstance, shouldOverrideTarget, behavior);\r\n        return mock;\r\n    }\r\n\r\n    private static cloneDeep<T>(target: T): T {\r\n        let copy = target;\r\n        if (!_.isFunction(target)) {\r\n            let func = (x: any): any => {\r\n                var value: any;\r\n                if (all.ProxyES5.isProxy(x))\r\n                    return x;\r\n            };\r\n            copy = _.cloneDeepWith(target, func);\r\n        }\r\n        return copy;\r\n    }\r\n\r\n    // setup\r\n\r\n    setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult> {\r\n        const call = MethodCallReturn.ofStaticMock(this, expression);\r\n        this._interceptor.addExpectedCall(call);\r\n        return call;\r\n    }\r\n\r\n    // verify\r\n\r\n    verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void {\r\n        const call = MethodCall.ofStaticMock(this, expression);\r\n        this._interceptor.addExpectedCall(call);\r\n        try {\r\n            this._interceptor.verifyCallCount(call, times);\r\n        }\r\n        catch (e) {\r\n            throw e;\r\n        }\r\n    }\r\n\r\n}","import * as all from \"./_all\";\r\nimport { MockBase } from \"./MockBase\";\r\nimport { MockBehavior } from \"./_all\";\r\nimport { InterceptorExecute } from \"./InterceptorExecute\";\r\nimport { MethodCall } from \"./MethodCall\";\r\nimport { MethodCallReturn } from \"./MethodCallReturn\";\r\n\r\nexport class DynamicMock<T> extends MockBase<T> {\r\n\r\n    private constructor(\r\n        target: T,\r\n        name: string,\r\n        canOverrideTarget: boolean,\r\n        behavior: all.MockBehavior) {\r\n\r\n        super(target, canOverrideTarget, behavior);\r\n\r\n        if (name)\r\n            this._name = name;\r\n\r\n        this._interceptor = new InterceptorExecute(this);\r\n        this._proxy = all.ProxyFactory.createProxyES6<T>(target, this._interceptor);\r\n    }\r\n\r\n    static ofType<U>(name: string, behavior: all.MockBehavior, shouldOverrideTarget: boolean): all.IMock<U> {\r\n        const mock: DynamicMock<U> = new DynamicMock<U>(<any>(() => { }), name, shouldOverrideTarget, behavior);\r\n        return mock;\r\n    }\r\n\r\n    // setup\r\n\r\n    setup<TResult>(expression: all.IFunc2<T, TResult>): MethodCallReturn<T, TResult> {\r\n        const call = MethodCallReturn.ofDynamicMock(this, expression);\r\n        this._interceptor.addExpectedCall(call);\r\n        return call;\r\n    }\r\n\r\n    // verify\r\n\r\n    verify<TResult>(expression: all.IFunc2<T, TResult>, times: all.Times): void {\r\n        const call = MethodCall.ofDynamicMock(this, expression);\r\n        this._interceptor.addExpectedCall(call);\r\n        try {\r\n            this._interceptor.verifyCallCount(call, times);\r\n        }\r\n        catch (e) {\r\n            throw e;\r\n        }\r\n    }\r\n\r\n}","import * as common from \"../Common/_all\";\r\nimport { MockBehavior } from \"./MockBehavior\";\r\nimport { IMock } from \"./IMock\";\r\nimport { StaticMock } from \"../StaticMock\";\r\nimport { DynamicMock } from \"../DynamicMock\";\r\n\r\nexport class MockApi {\r\n\r\n    static ofInstance<U>(targetInstance: U, behavior = MockBehavior.Loose, shouldOverrideTarget = true): IMock<U> {\r\n        const mock = StaticMock.ofInstance(targetInstance, behavior, shouldOverrideTarget);\r\n        return mock;\r\n    }\r\n\r\n    static ofType<U>(targetConstructor?: common.CtorWithArgs<U>, behavior = MockBehavior.Loose, shouldOverrideTarget = true, ...targetConstructorArgs: any[]): IMock<U> {\r\n        let mock: IMock<U>;\r\n        if (targetConstructor)\r\n            mock = MockApi.ofType2(targetConstructor, targetConstructorArgs, behavior, shouldOverrideTarget);\r\n        else\r\n            mock = DynamicMock.ofType<U>(undefined, behavior, shouldOverrideTarget);\r\n        return mock;\r\n    }\r\n\r\n    static ofType2<U>(targetConstructor: common.CtorWithArgs<U>, targetConstructorArgs: any[], behavior = MockBehavior.Loose, shouldOverrideTarget = true): IMock<U> {\r\n        const mock: IMock<U> = StaticMock.ofType(targetConstructor, behavior, shouldOverrideTarget, targetConstructorArgs);\r\n        return mock;\r\n    }\r\n\r\n}","import * as common from \"../Common/_all\";\r\nimport * as match from \"../Match/_all\";\r\n\r\nexport class It {\r\n\r\n    static isValue<T>(x: T): T {\r\n        let matcher: match.IMatch = new match.MatchValue(x);\r\n        return <any>matcher;\r\n    }\r\n\r\n    static isObjectWith<T>(x: { [P in keyof T]?: T[P] }): T {\r\n        let matcher: match.IMatch = new match.MatchObjectWith(x);\r\n        return <any>matcher;\r\n    }\r\n\r\n    static isAnyObject<T>(x: common.Ctor<T>): T {\r\n        let matcher: match.IMatch = new match.MatchAnyObject(x);\r\n        return <any>matcher;\r\n    }\r\n\r\n    static isAny(): any {\r\n        let matcher: match.IMatch = new match.MatchAny();\r\n        return <any>matcher;\r\n    }\r\n\r\n    static isAnyString(): string {\r\n        let matcher: match.IMatch = new match.MatchAnyString();\r\n        return <any>matcher;\r\n    }\r\n\r\n    static isAnyNumber(): number {\r\n        let matcher: match.IMatch = new match.MatchAnyNumber();\r\n        return <any>matcher;\r\n    }\r\n\r\n    static is<T>(predicate: common.IFunc2<T, boolean>): T {\r\n        let matcher: match.IMatch = new match.MatchPred(predicate);\r\n        return <any>matcher;\r\n    }\r\n}\r\n","import * as _ from \"lodash\";\r\nimport * as common from \"../Common/_all\";\r\nimport { MockBehavior } from \"./MockBehavior\";\r\nimport { IMock } from \"./IMock\";\r\nimport { StaticMock } from \"../StaticMock\";\r\nimport { IGlobalMock } from \"./IGlobalMock\";\r\nimport { GlobalMock as GMock, GlobalType } from \"../GlobalMock\";\r\nimport { DynamicMock } from \"../DynamicMock\";\r\n\r\nexport class GlobalMockApi {\r\n\r\n    static ofInstance<U>(targetInstance: U, globalName?: string, container: Object = window, behavior = MockBehavior.Loose): IGlobalMock<U> {\r\n        const mock = StaticMock.ofGlobalInstance(targetInstance, behavior);\r\n        const type = _.isFunction(targetInstance) ? GlobalType.Function : GlobalType.Value;\r\n        return new GMock(mock, globalName, type, container);\r\n    }\r\n\r\n    static ofType<U>(targetConstructor: common.Ctor<U>, container: Object = window, behavior = MockBehavior.Loose): IGlobalMock<U> {\r\n        const targetInstance = new targetConstructor();\r\n        const mock: IMock<U> = StaticMock.ofInstance(targetInstance, behavior, false);\r\n        return new GMock(mock, undefined, GlobalType.Class, container);\r\n    }\r\n\r\n    static ofType2<U>(globalName: string, container: Object = window, behavior = MockBehavior.Loose): IGlobalMock<U> {\r\n        const mock: IMock<U> = DynamicMock.ofType<U>(globalName, behavior, false);\r\n        return new GMock(mock, undefined, GlobalType.Class, container);\r\n    }\r\n\r\n}","import * as _ from \"lodash\";\r\nimport * as all from \"./_all\";\r\nimport { GlobalType } from \"./GlobalMock\";\r\n\r\nexport class GlobalScope implements all.IUsingResult {\r\n\r\n    constructor(private _args: all.IGlobalMock<any>[]) {\r\n    }\r\n\r\n    with(action: all.IAction): void {\r\n        let initial: all.PropDescriptorMap = {};\r\n\r\n        try {\r\n            _.each(this._args, (a: all.IGlobalMock<any>) => {\r\n                let containerProps = all.PropertyRetriever.getOwnAndPrototypeEnumerablesAndNonenumerables(a.container);\r\n                let prop = _.find(containerProps, (p: { name: string; desc: all.PropDescriptor }) => p.name === a.name);\r\n\r\n                if (prop) {\r\n\r\n                    initial[a.name] = prop.desc;\r\n\r\n                    let desc: all.PropDescriptor = {};\r\n\r\n                    switch (a.type) {\r\n\r\n                        case GlobalType.Class:\r\n                            //TODO: return a new mock every time with same interceptor as the one used by mock passed in as arg to 'using' \r\n                            //      (to support different ctor arguments)\r\n                            desc.value = () => a.mock.object;\r\n                            break;\r\n\r\n                        case GlobalType.Function:\r\n                            desc.value = a.mock.object;\r\n                            break;\r\n\r\n                        case GlobalType.Value:\r\n                            desc.get = () => a.mock.object;\r\n                            break;\r\n\r\n                        default:\r\n                            throw new all.MockException(\r\n                                all.MockExceptionReason.UnknownGlobalType, a, `unknown global type: ${a.type}`);\r\n                    }\r\n\r\n                    try {\r\n                        Object.defineProperty(a.container, a.name, desc);\r\n                    } catch (e) {\r\n                        console.log(`1: ${e}`);\r\n                    }\r\n                }\r\n            });\r\n\r\n            action.apply(this, this._args);\r\n\r\n        } catch (e) {\r\n            console.log(`2: ${e}`);\r\n        } finally {\r\n            _.each(this._args, (a: all.IGlobalMock<any>) => {\r\n                    let desc: all.PropDescriptor = initial[a.name];\r\n\r\n                    if (desc) {\r\n\r\n                        switch (a.type) {\r\n\r\n                            case GlobalType.Class:\r\n                                break;\r\n\r\n                            case GlobalType.Function:\r\n                                break;\r\n\r\n                            case GlobalType.Value:\r\n                                desc.configurable = true;\r\n                                break;\r\n\r\n                            default:\r\n                        }\r\n\r\n                        try {\r\n                            Object.defineProperty(a.container, a.name, desc);\r\n                        } catch (e) {\r\n                            console.log(`3: ${e}`);\r\n                        }\r\n                    }\r\n                });\r\n        }\r\n    }\r\n}","import * as all from \"./_all\";\r\nimport { IUsingResult } from \"./IUsing\";\r\nimport { GlobalScope as GScope } from \"../GlobalScope\";\r\n\r\nexport class GlobalScopeApi {\r\n\r\n    static using(...args: all.IGlobalMock<any>[]): IUsingResult {\r\n        let scope = new GScope(args);\r\n        return scope;\r\n    }\r\n\r\n}"]}