Socket
Socket
Sign inDemoInstall

typemoq

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typemoq - npm Package Compare versions

Comparing version 1.4.1 to 1.4.2

5

CHANGELOG.md

@@ -0,1 +1,6 @@

v1.4.2 / 2017-04-20
===================
* fix dynamic mock matcher ignoring setup params #55
v1.4.1 / 2017-03-23

@@ -2,0 +7,0 @@ ===================

2

dist/typemoq-min.js

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash")):"function"==typeof define&&define.amd?define(["exports","lodash"],e):e(t.TypeMoq=t.TypeMoq||{},t._)}(this,function(t,e){!function(t){t[t.Loose=0]="Loose",t[t.Strict=1]="Strict"}(t.MockBehavior||(t.MockBehavior={})),function(t){t[t.InAnyOrder=0]="InAnyOrder",t[t.InSequence=1]="InSequence"}(t.ExpectedCallType||(t.ExpectedCallType={}));var n=function(){function t(t,n,r,o){this._condition=t,this.min=n,this.max=r,this._failMessage=e.template(o)}return t.prototype.failMessage=function(t){return this._failMessage({i:t,n:this.min,m:this._lastCallCount})},t.prototype.verify=function(t){return this._lastCallCount=t,this._condition(t)},t.exactly=function(e){return new t(function(t){return t===e},e,e,t.NO_MATCHING_CALLS_EXACTLY_N_TIMES)},t.never=function(){return t.exactly(0)},t.once=function(){return t.exactly(1)},t.atLeastOnce=function(){return new t(function(t){return t>=1},1,255,t.NO_MATCHING_CALLS_AT_LEAST_ONCE)},t.atMostOnce=function(){return new t(function(t){return t>=0&&1>=t},0,1,t.NO_MATCHING_CALLS_AT_MOST_ONCE)},t}();n.NO_MATCHING_CALLS_EXACTLY_N_TIMES="expected invocation of <%= i %> <%= n %> times, invoked <%= m %> times",n.NO_MATCHING_CALLS_AT_LEAST_ONCE="expected invocation of <%= i %> at least once, invoked <%= m %> times",n.NO_MATCHING_CALLS_AT_MOST_ONCE="expected invocation of <%= i %> at most once, invoked <%= m %> times";var r,o=function(){function t(){}return t.getOwnEnumerables=function(t){return this._getPropertyNames(t,!0,!1,this._enumerable)},t.getOwnNonenumerables=function(t){return this._getPropertyNames(t,!0,!1,this._notEnumerable)},t.getOwnEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!0,!1,this._enumerableAndNotEnumerable)},t.getPrototypeEnumerables=function(t){return this._getPropertyNames(t,!1,!0,this._enumerable)},t.getPrototypeNonenumerables=function(t){return this._getPropertyNames(t,!1,!0,this._notEnumerable)},t.getPrototypeEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!1,!0,this._enumerableAndNotEnumerable)},t.getOwnAndPrototypeEnumerables=function(t){return this._getPropertyNames(t,!0,!0,this._enumerable)},t.getOwnAndPrototypeNonenumerables=function(t){return this._getPropertyNames(t,!0,!0,this._notEnumerable)},t.getOwnAndPrototypeEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!0,!0,this._enumerableAndNotEnumerable)},t._enumerable=function(t,e){return t.propertyIsEnumerable(e)},t._notEnumerable=function(t,e){return!t.propertyIsEnumerable(e)},t._enumerableAndNotEnumerable=function(t,e){return!0},t._getPropertyNames=function(t,n,r,o){var i=[];do{if(n)for(var u=Object.getOwnPropertyNames(t),c=function(n){var r=e.find(i,function(t){return t.name===n});if(!r&&o(t,n)){var u=Object.getOwnPropertyDescriptor(t,n);i.push({name:n,desc:u})}},a=0,s=u;a<s.length;a++){var p=s[a];c(p)}if(!r)break;n=!0}while(t=Object.getPrototypeOf(t));return i},t}(),i=function(){function t(){}return t.functionName=function(t){var e;if(t.name)e=t.name;else{var n=t.toString();n=n.substr("function ".length),e=n.substr(0,n.indexOf("("))}return e},t.objectName=function(e){var n=t.functionName(e.constructor);return n},t.argsName=function(t){var n=e.join(t);return n},t.conthunktor=function(t,e){var n=new(t.bind.apply(t,[void 0].concat(e)));return n},t.clone=function(t,e){for(var n=o.getOwnAndPrototypeEnumerablesAndNonenumerables(e),r=0,i=n;r<i.length;r++){var u=i[r];Object.defineProperty(t,u.name,u.desc)}},t}(),u=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(n,r){var o=t.call(this,r)||this;return o.name=n,Object.setPrototypeOf(o,e.prototype),o}return u(e,t),e.prototype.toString=function(){var t=this.message?this.name+" - "+this.message:this.name;return t},e}(Error),a=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){t[t.NoSetup="no setup expression found for"]="NoSetup",t[t.MoreThanOneSetup="more than one setup expression found for"]="MoreThanOneSetup",t[t.InvalidSetup="invalid setup expression"]="InvalidSetup",t[t.InvalidMatcher="invalid matching expression"]="InvalidMatcher",t[t.InvalidProxyArg="invalid proxy argument"]="InvalidProxyArg",t[t.UnknownGlobalType="unknown global type"]="UnknownGlobalType",t[t.CallCountVerificationFailed="invocation count verification failed"]="CallCountVerificationFailed",t[t.CallOrderVerificationFailed="invocation order verification failed"]="CallOrderVerificationFailed",t[t.InvalidDynamicProxyRuntime="invalid dynamic proxy runtime"]="InvalidDynamicProxyRuntime"}(r||(r={}));var s=function(t){function e(n,r,o){void 0===o&&(o=void 0);var i=t.call(this,"MockException",o)||this;return i.reason=n,i.ctx=r,i.message=o,Object.setPrototypeOf(i,e.prototype),i}return a(e,t),e.prototype.toString=function(){var t=this.name+" - "+this.reason;return this.message&&(t=t+" ("+this.message+")"),t},e}(c),p=function(){function t(){}return t}();p.IMATCH_ID_VALUE="438A51D3-6864-49D7-A655-CA1153B86965",p.IMATCH_ID_NAME="___id",p.IMATCH_MATCHES_NAME="___matches",p.IPROXY_ID_VALUE="BCDF5CE5-F0DF-40B7-8BA0-69DF395033C8",p.IPROXY_ID_NAME="___id";var l,f=function(){function t(t){this._ctor=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!1;return t&&t.constructor.prototype==this._ctor.prototype&&(e=!0),e},t.prototype.toString=function(){var t="It.isAnyObject("+i.functionName(this._ctor)+")";return t},t}(),h=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!0;return e},t.prototype.toString=function(){return"It.isAny()"},t}(),y=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isString(t)&&(n=!0),n},t.prototype.toString=function(){return"It.isAnyString()"},t}(),_=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isNumber(t)&&(n=!0),n},t.prototype.toString=function(){return"It.isAnyNumber()"},t}(),v=function(){function t(t){this._pred=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!1;return t&&this._pred(t)&&(e=!0),e},t.prototype.toString=function(){var t="It.is("+this._pred+")";return t},t}(),d=function(){function t(t){this._value=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isEqual(this._value,t)&&(n=!0),n},t.prototype.toString=function(){var t="It.isValue("+this._value+")";return t},t}(),b=function(){function t(t){this._value=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1,r=e.pick(t,e.keys(this._value));return e.isEqual(this._value,r)&&(n=!0),n},t.prototype.toString=function(){var t="It.isObjectWith("+this._value+")";return t},t}();!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.PROPERTY=1]="PROPERTY",t[t.FUNCTION=2]="FUNCTION"}(l||(l={}));var m;!function(t){t[t.STATIC=0]="STATIC",t[t.DYNAMIC=1]="DYNAMIC"}(m||(m={}));var g,C=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){t[t.NONE=0]="NONE",t[t.SETUP=1]="SETUP",t[t.EXECUTE=2]="EXECUTE"}(g||(g={}));var O,I=function(){function t(t,e){this.proxyType=t,this.callType=e,this.invocationType=g.NONE}return t}(),P=function(t){function e(e,n,r,o,i){void 0===o&&(o=m.STATIC),void 0===i&&(i=l.FUNCTION);var u=t.call(this,o,i)||this;return u._that=e,u._property=n,u._args=r,u}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args||{length:0,callee:null}},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){var t={};this._that?i.clone(t,this._that):t=this._property.obj,this.returnValue=this._property.toFunc.apply(t,this._args)},e.prototype.toString=function(){var t=this.property+"("+i.argsName(this.args)+")";return t},e}(I),w=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.PROPERTY);var i=t.call(this,r,o)||this;return i._property=e,i.value=n,i.returnValue=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){var t=[];return Object.defineProperty(t,"callee",{configurable:!0,enumerable:!0,writable:!1,value:null}),t},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=""+this.property;return t},e}(I),N=function(t){function e(e,n){var r=t.call(this,e,n,m.DYNAMIC,l.UNKNOWN)||this;return r.returnValue=n,r}return C(e,t),e}(w),x=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.PROPERTY);var i=t.call(this,r,o)||this;return i._property=e,i._args=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this._property.obj[this._property.name]=this._args[0],this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=this.property+" = "+i.argsName(this.args[0]);return t},e}(I),A=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.FUNCTION);var i=t.call(this,r,o)||this;return i._property=e,i._getter=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){var t=[];return Object.defineProperty(t,"callee",{configurable:!0,enumerable:!0,writable:!1,value:null}),t},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=""+this.property;return t},e}(I),E=function(t){function e(e,n,r,o,i){void 0===o&&(o=m.STATIC),void 0===i&&(i=l.FUNCTION);var u=t.call(this,o,i)||this;return u._property=e,u._setter=n,u._args=r,u}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this._property.obj[this._property.name]=this._args[0],this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=this.property+"("+i.argsName(this.args[0])+")";return t},e}(I),T=function(){function t(t,e,n){this.obj=t,this.name=e,this.desc=n}return Object.defineProperty(t.prototype,"toFunc",{get:function(){var t;return t=e.isFunction(this.obj)?this.obj:this.obj[this.name]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=i.objectName(this.obj),e=t+"."+this.name;return e},t}(),j=function(){function t(t,e,n){this.obj=t,this.name=e,this.desc=n}return t.prototype.toString=function(){var t=i.objectName(this.obj),e=t+"."+this.name;return e},t}(),k=function(){function t(t,n){var r=this;this.___id=p.IPROXY_ID_VALUE,this.check(n);var i=this,u=o.getOwnAndPrototypeEnumerablesAndNonenumerables(n);e.each(u,function(o){if(e.isFunction(o.desc.value)){var u={configurable:o.desc.configurable,enumerable:o.desc.enumerable,writable:o.desc.writable};r.defineMethodProxy(i,t,n,o.name,u)}else{var u={configurable:o.desc.configurable,enumerable:o.desc.enumerable};void 0!==o.desc.value?r.defineValuePropertyProxy(i,t,n,o.name,o.desc.value,u):r.defineGetSetPropertyProxy(i,t,n,o.name,o.desc.get,o.desc.set,u)}})}return t.of=function(n,r){t.check(n);var o;if(e.isFunction(n)){var u=i.functionName(n);o=t.methodProxyValue(void 0,r,n,u,null)}else o=new t(r,n);return o},t.isProxy=function(t){return e.isNil(t)||e.isUndefined(t[p.IPROXY_ID_NAME])||t[p.IPROXY_ID_NAME]!==p.IPROXY_ID_VALUE?!1:!0},t.check=function(n){t.checkNotNullOrUndefined(n);var o=!1;if((e.isFunction(n)||e.isObject(n)&&!t.isPrimitiveObject(n))&&(o=!0),!o)throw new s(r.InvalidProxyArg,n,"'"+n+"'; argument should be a function or a non primitive object")},t.prototype.check=function(n){t.checkNotNullOrUndefined(n);var o=!1;if(e.isFunction(n)||!e.isObject(n)||t.isPrimitiveObject(n)||(o=!0),!o)throw new s(r.InvalidProxyArg,n,"'"+n+"'; argument should be a non primitive object")},t.checkNotNullOrUndefined=function(t){if(e.isNil(t))throw new s(r.InvalidProxyArg,t,"'"+t+"'; argument is required")},t.isPrimitiveObject=function(t){var n=!1;return(e.isFunction(t)||e.isArray(t)||e.isDate(t)||e.isNull(t))&&(n=!0),n},t.prototype.defineMethodProxy=function(e,n,r,o,i){void 0===i&&(i={configurable:!0,enumerable:!0,writable:!1}),i.value=t.methodProxyValue(e,n,r,o,i),this.defineProperty(e,o,i)},t.methodProxyValue=function(t,e,n,r,o){function i(){var i=new T(n,r,o),u=new P(t,i,arguments);return e.intercept(u),u.returnValue}return i},t.prototype.defineValuePropertyProxy=function(t,e,n,r,o,i){function u(){var t=new j(n,r),i=new w(t,o);return e.intercept(i),i.returnValue}function c(t){var o=new j(n,r),i=new x(o,arguments);e.intercept(i)}void 0===i&&(i={configurable:!0,enumerable:!0}),i.get=u,i.set=c,this.defineProperty(t,r,i)},t.prototype.defineGetSetPropertyProxy=function(t,e,n,r,o,i,u){function c(){var t=new j(n,r),i=new A(t,o);return e.intercept(i),i.returnValue}function a(t){var o=new j(n,r),u=new E(o,i,arguments);e.intercept(u)}void 0===u&&(u={configurable:!0,enumerable:!0}),u.get=c,u.set=a,this.defineProperty(t,r,u)},t.prototype.defineProperty=function(t,e,n){try{Object.defineProperty(t,e,n)}catch(r){console.log(r.message)}},t}(),S=function(){function t(t){this.___id=p.IPROXY_ID_VALUE;var e=new Proxy(function(){},t);return e}return t.of=function(e){t.check();var n=new t(e);return n},t.check=function(){if("undefined"==typeof Proxy)throw new s(r.InvalidDynamicProxyRuntime,null,"ES6 Proxy object not detected; the dynamic mocking feature requires ES6 Proxy object support")},t}(),M=function(){function t(t){this._interceptor=t}return t.prototype.apply=function(t,e,n){var r=i.functionName(t),o=new T(t,r),u=new P(t,o,n,m.DYNAMIC);return this._interceptor.intercept(u),u.returnValue},t.prototype.get=function(t,n,r){var o=this,i=t[n],u=new j(t,n),c=new N(u,i);return this._interceptor.intercept(c),!e.isFunction(i)&&c.callType==l.PROPERTY&&c.property.desc?c.returnValue:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];o._interceptor.removeInvocation(c);var i=new T(t,n),u=new P(t,i,e,m.DYNAMIC);return o._interceptor.intercept(u),u.returnValue}},t.prototype.set=function(t,e,n,r){var o=new j(t,e),i=new x(o,[n],m.DYNAMIC);return this._interceptor.intercept(i),Reflect.set(t,e,n,r)},t.prototype.defineProperty=function(t,e,n){return n.configurable=!0,Reflect.defineProperty(t,e,n)},t}(),V=function(){function t(){}return t.createProxy=function(t,e){var n=k.of(e,t);return n},t.createProxyES6=function(t){var e=new M(t),n=S.of(e);return n},t}(),D=function(){function n(e,n,r){void 0===r&&(r=t.MockBehavior.Loose),this.targetInstance=e,this.canOverrideTarget=n,this.behavior=r,this._id=this.generateId(),this._name=this.getNameOf(this.targetInstance)}return Object.defineProperty(n.prototype,"object",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"callBase",{get:function(){return this._callBase},set:function(t){this._callBase=t},enumerable:!0,configurable:!0}),n.prototype.generateId=function(){return"Mock<"+e.uniqueId()+">"},n.prototype.getNameOf=function(t){var n;if(e.isFunction(t))n=i.functionName(t);else if(e.isObject(t)){var r=t.constructor;n=i.functionName(r)}return n&&(n=n.trim()),n},n.prototype.verifyAll=function(){try{this._interceptor.verify()}catch(t){throw t}},n.prototype.reset=function(){this._interceptor.reset()},n}();!function(t){t[t.Continue=0]="Continue",t[t.Stop=1]="Stop"}(O||(O={}));var L,U=function(){function t(t){this.mock=t,this._actualInvocations=[],this._expectedCalls=[]}return Object.defineProperty(t.prototype,"behavior",{get:function(){return this.mock.behavior},enumerable:!0,configurable:!0}),t.prototype.addInvocation=function(t){this._actualInvocations.push(t)},t.prototype.removeInvocation=function(t){e.remove(this._actualInvocations,function(e){return e===t})},t.prototype.actualInvocations=function(){return this._actualInvocations},t.prototype.clearInvocations=function(){this._actualInvocations.splice(0,this._actualInvocations.length)},t.prototype.addExpectedCall=function(t){this._expectedCalls.push(t)},t.prototype.removeExpectedCall=function(t){e.filter(this._expectedCalls,function(e){return e.id!==t.id})},t.prototype.expectedCalls=function(){return this._expectedCalls},t.prototype.clearExpectedCalls=function(){this._expectedCalls.splice(0,this._expectedCalls.length)},t.prototype.reset=function(){this.clearInvocations(),this.clearExpectedCalls()},t}(),F=function(){function t(){}return t}(),B=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return e.addInvocation(t),O.Continue},t}(),R=function(){function n(){}return n.prototype.handleIntercept=function(n,o,i){var u=o.expectedCalls().slice(),c=function(t){return t.matches(n)},a=e.filter(u,function(t){return c(t)});if(a.length>1&&(c=function(t){return!t.isInvoked&&t.matches(n)}),i.call=e.find(u,function(t){return c(t)}),null!=i.call){if(n.proxyType==m.DYNAMIC&&n.callType==l.UNKNOWN&&n.invocationType==g.EXECUTE&&(n.callType=i.call.setupCall.callType,n.callType==l.FUNCTION))return O.Stop;i.call.evaluatedSuccessfully()}else if(o.behavior==t.MockBehavior.Strict)throw new s(r.NoSetup,n,"'"+n+"'");return O.Continue},n}(),Y=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){this._ctx=e;var r=n.call;return null!=r?(r.execute(t),O.Stop):O.Continue},t}(),H=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return e.mock.callBase?(t.invokeBase(),O.Stop):O.Continue},t}(),G=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return O.Continue},t}(),q=function(){function t(t){this._interceptorContext=new U(t)}return Object.defineProperty(t.prototype,"interceptorContext",{get:function(){return this._interceptorContext},enumerable:!0,configurable:!0}),t.prototype.intercept=function(t){var n=this,r=new F;t.invocationType=g.EXECUTE,e.some(this.interceptionStrategies(),function(e){return O.Stop===e.handleIntercept(t,n.interceptorContext,r)?!0:void 0})},t.prototype.removeInvocation=function(t){this._interceptorContext.removeInvocation(t)},t.prototype.addExpectedCall=function(t){this._interceptorContext.addExpectedCall(t)},t.prototype.verify=function(){for(var t=this._interceptorContext.expectedCalls(),n=e.filter(t,function(t){return t.isVerifiable}),r=0,o=n;r<o.length;r++){var i=o[r];this.verifyCallCount(i,i.expectedCallCount)}var u=e.filter(t,function(t){return t.isInSequence});this.verifyCallsOrder(u)},t.prototype.verifyCallCount=function(t,n){var r=this._interceptorContext.actualInvocations(),o=e.filter(r,function(e){return t.matches(e)}).length;n.verify(o)||this.throwVerifyCallCountException(t.setupCall,n)},t.prototype.throwVerifyCallCountException=function(t,e){var n=new s(r.CallCountVerificationFailed,t,e.failMessage(t));throw n},t.prototype.verifyCallsOrder=function(t){var e=this._interceptorContext.actualInvocations();this.checkCallOrderExpectations(t,e)},t.prototype.checkCallOrderExpectations=function(t,n){var r=function(r){for(var o=e.sum(r),i=0,u=0;u<r.length;u++)for(var c=t[u],a=r[u],s=1;a>=s;s++){var p=n[i++];if(!c.matches(p))return!1}return i===o},o=!1,i=function(e,n){if(!o)if(n===t.length)o=r(e);else for(var u=t[n].expectedCallCount.min;u<=t[n].expectedCallCount.max;u++)e[n]=u,i(e,n+1)};i([],0),o||this.throwVerifyCallOrderException()},t.prototype.throwVerifyCallOrderException=function(){var t=new s(r.CallOrderVerificationFailed,null);throw t},t.prototype.reset=function(){this._interceptorContext.reset()},t.prototype.interceptionStrategies=function(){var t=[new B,new R,new Y,new H,new G];return t},t}(),X=function(){function t(){}return Object.defineProperty(t.prototype,"interceptedCall",{get:function(){return this._interceptedCall},enumerable:!0,configurable:!0}),t.prototype.intercept=function(t){if(t.invocationType=g.SETUP,t.proxyType==m.DYNAMIC&&t.callType==l.UNKNOWN&&(t.callType=l.PROPERTY),this._interceptedCall)throw new s(r.MoreThanOneSetup,t,"'"+t+"'; setup should contain only one expression");this._interceptedCall=t},t.prototype.removeInvocation=function(t){this._interceptedCall&&this._interceptedCall===t&&(this._interceptedCall=void 0)},t}(),W=function(){function o(t,e,n,o){if(this.mock=t,this._setupExpression=e,this._callCount=0,this._id=this.generateId(),e(o),!n.interceptedCall)throw new s(r.InvalidSetup,this._setupExpression,"'"+this._setupExpression+"'");var i=n.interceptedCall,u=this.transformToMatchers(i.args);Object.defineProperty(u,"callee",{configurable:!0,enumerable:!0,writable:!1,value:i.args.callee}),i.args=u,this._setupCall=i}return o.ofStaticMock=function(t,e){var n=new X,r=V.createProxy(n,t.targetInstance),i=new o(t,e,n,r);return i},o.ofDynamicMock=function(t,e){var n=new X,r=V.createProxyES6(n),i=new o(t,e,n,r);return i},o.prototype.generateId=function(){return"MethodCall<"+e.uniqueId()+">"},o.prototype.transformToMatchers=function(t){var n=[];return e.each(t,function(t){if(e.isObject(t))if(e.isUndefined(t[p.IMATCH_MATCHES_NAME])||e.isUndefined(t[p.IMATCH_ID_NAME])||t[p.IMATCH_ID_NAME]!==p.IMATCH_ID_VALUE){var r=new v(function(e){return e===t});n.push(r)}else n.push(t);else{var r=new d(t);n.push(r)}}),n},Object.defineProperty(o.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"setupExpression",{get:function(){return this._setupExpression},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"setupCall",{get:function(){return this._setupCall},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isVerifiable",{get:function(){return this._isVerifiable},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isInSequence",{get:function(){return this._expectedCallType===t.ExpectedCallType.InSequence},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"expectedCallCount",{get:function(){return this._expectedCallCount},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isInvoked",{get:function(){return this._isInvoked},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"callCount",{get:function(){return this._callCount},enumerable:!0,configurable:!0}),o.prototype.evaluatedSuccessfully=function(){this._evaluatedSuccessfully=!0},o.prototype.matches=function(t){var n=!1;return this._setupCall.property&&t&&t.property&&this._setupCall.property.name===t.property.name&&this._setupCall.args.length>=t.args.length&&(n=!0,e.each(this._setupCall.args,function(e,r){var o=e,i=t.args[r];n&&!o.___matches(i)&&(n=!1)})),n},o.prototype.execute=function(t){if(this._isInvoked=!0,null!=this._setupCallback&&this._setupCallback.apply(this,t.args),null!=this._thrownException)throw this._thrownException;this._callCount++},o.prototype.verifiable=function(e,r){void 0===e&&(e=n.atLeastOnce()),void 0===r&&(r=t.ExpectedCallType.InAnyOrder),this._isVerifiable=!0,this._expectedCallCount=e,this._expectedCallType=r},o}(),K=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(t){function e(e,n,r,o){var i=t.call(this,e,n,r,o)||this;return i._overrideTarget=e.canOverrideTarget,i}return K(e,t),e.ofStaticMock=function(t,n){var r=new X,o=V.createProxy(r,t.targetInstance),i=new e(t,n,r,o);return i},e.ofDynamicMock=function(t,n){var r=new X,o=V.createProxyES6(r),i=new e(t,n,r,o);return i},e.prototype.execute=function(e){t.prototype.execute.call(this,e),this._callBase?e.invokeBase():this.hasReturnValue&&(e.returnValue=this._returnValueFunc.apply(this,e.args),e.property.desc={value:this.setupCall.property.desc&&this.setupCall.property.desc.value})},e.prototype.callback=function(t){return this._setupCallback=t,this},e.prototype["throws"]=function(t){return this._thrownException=t,this},e.prototype.returns=function(t){if(this._returnValueFunc=t,this.hasReturnValue=!0,this._overrideTarget){var e=this.mock.targetInstance,n=this.setupCall.property.name,r=this.setupCall.property.desc;r&&(r.configurable=!0,r.enumerable=!0,r.value=this._returnValueFunc,Object.defineProperty(e,n,r))}return this},e.prototype.callBase=function(){return this._callBase=!0,this},e}(W),J=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q=function(t){function n(e,n,r){var o=t.call(this,e,n,r)||this;return o._interceptor=new q(o),o._proxy=V.createProxy(o._interceptor,e),o}return J(n,t),n.ofInstance=function(t,e){t=n.cloneDeep(t);var r=new n(t,!0,e);return r},n.ofGlobalInstance=function(t,e){var r=new n(t,!1,e);return r},n.ofType=function(t,e,r){var o=i.conthunktor(t,r),u=new n(o,!0,e);return u},n.cloneDeep=function(t){var n=t;if(!e.isFunction(t)){var r=function(t){return k.isProxy(t)?t:void 0};n=e.cloneDeepWith(t,r)}return n},n.prototype.setup=function(t){var e=z.ofStaticMock(this,t);return this._interceptor.addExpectedCall(e),e},n.prototype.verify=function(t,e){var n=W.ofStaticMock(this,t);this._interceptor.addExpectedCall(n);try{this._interceptor.verifyCallCount(n,e)}catch(r){throw r}},n}(D),Z=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$=function(t){function e(e,n,r){var o=t.call(this,{},n,r)||this;return e&&(o._name=e),o._interceptor=new q(o),o._proxy=V.createProxyES6(o._interceptor),o}return Z(e,t),e.ofType=function(t,n){var r=new e(t,!0,n);return r},e.prototype.setup=function(t){var e=z.ofDynamicMock(this,t);return this._interceptor.addExpectedCall(e),e},e.prototype.verify=function(t,e){var n=W.ofDynamicMock(this,t);this._interceptor.addExpectedCall(n);try{this._interceptor.verifyCallCount(n,e)}catch(r){throw r}},e}(D),tt=function(){function e(){}return e.ofInstance=function(e,n){void 0===n&&(n=t.MockBehavior.Loose);var r=Q.ofInstance(e,n);return r},e.ofType=function(n,r){void 0===r&&(r=t.MockBehavior.Loose);for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var u;return u=n?e.ofType2(n,o,r):$.ofType(void 0,r)},e.ofType2=function(e,n,r){void 0===r&&(r=t.MockBehavior.Loose);var o=Q.ofType(e,r,n);return o},e}(),et=function(){function t(){}return t.isValue=function(t){var e=new d(t);return e},t.isObjectWith=function(t){var e=new b(t);return e},t.isAnyObject=function(t){var e=new f(t);return e},t.isAny=function(){var t=new h;return t},t.isAnyString=function(){var t=new y;return t},t.isAnyNumber=function(){var t=new _;return t},t.is=function(t){var e=new v(t);return e},t}();!function(t){t[t.Class=0]="Class",t[t.Function=1]="Function",t[t.Value=2]="Value"}(L||(L={}));var nt=function(){function t(t,e,n,r){this.mock=t,this._name=e,this._type=n,this.container=r,this._name||(this._name=t.name)}return Object.defineProperty(t.prototype,"object",{get:function(){return this.mock.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name||this.mock.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"behavior",{get:function(){return this.mock.behavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"callBase",{get:function(){return this.mock.callBase},set:function(t){this.mock.callBase=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),t.prototype.setup=function(t){return this.mock.setup(t)},t.prototype.verify=function(t,e){this.mock.verify(t,e)},t.prototype.verifyAll=function(){this.mock.verifyAll()},t.prototype.reset=function(){this.mock.reset()},t}(),rt=function(){function n(){}return n.ofInstance=function(n,r,o,i){void 0===o&&(o=window),void 0===i&&(i=t.MockBehavior.Loose);var u=Q.ofGlobalInstance(n,i),c=e.isFunction(n)?L.Function:L.Value;return new nt(u,r,c,o)},n.ofType=function(e,n,r){void 0===n&&(n=window),void 0===r&&(r=t.MockBehavior.Loose);var o=new e,i=Q.ofInstance(o,r);return new nt(i,void 0,L.Class,n)},n.ofType2=function(e,n,r){void 0===n&&(n=window),void 0===r&&(r=t.MockBehavior.Loose);var o=$.ofType(e,r);return new nt(o,void 0,L.Class,n)},n}(),ot=function(){function t(t){this._args=t}return t.prototype["with"]=function(t){var n={};try{e.each(this._args,function(t){var i=o.getOwnAndPrototypeEnumerablesAndNonenumerables(t.container),u=e.find(i,function(e){return e.name===t.name});if(u){n[t.name]=u.desc;var c={};switch(t.type){case L.Class:c.value=function(){return t.mock.object};break;case L.Function:c.value=t.mock.object;break;case L.Value:c.get=function(){return t.mock.object};break;default:throw new s(r.UnknownGlobalType,t,"unknown global type: "+t.type)}try{Object.defineProperty(t.container,t.name,c)}catch(a){console.log("1: "+a)}}}),t.apply(this,this._args)}catch(i){console.log("2: "+i)}finally{e.each(this._args,function(t){var e=n[t.name];if(e){switch(t.type){case L.Class:break;case L.Function:break;case L.Value:e.configurable=!0}try{Object.defineProperty(t.container,t.name,e)}catch(r){console.log("3: "+r)}}})}},t}(),it=function(){function t(){}return t.using=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new ot(t);return n},t}();t.Mock=tt,t.It=et,t.Times=n,t.GlobalMock=rt,t.GlobalScope=it,t.MockException=s,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("lodash")):"function"==typeof define&&define.amd?define(["exports","lodash"],e):e(t.TypeMoq=t.TypeMoq||{},t._)}(this,function(t,e){!function(t){t[t.Loose=0]="Loose",t[t.Strict=1]="Strict"}(t.MockBehavior||(t.MockBehavior={})),function(t){t[t.InAnyOrder=0]="InAnyOrder",t[t.InSequence=1]="InSequence"}(t.ExpectedCallType||(t.ExpectedCallType={}));var n=function(){function t(t,n,r,o){this._condition=t,this.min=n,this.max=r,this._failMessage=e.template(o)}return t.prototype.failMessage=function(t){return this._failMessage({i:t,n:this.min,m:this._lastCallCount})},t.prototype.verify=function(t){return this._lastCallCount=t,this._condition(t)},t.exactly=function(e){return new t(function(t){return t===e},e,e,t.NO_MATCHING_CALLS_EXACTLY_N_TIMES)},t.never=function(){return t.exactly(0)},t.once=function(){return t.exactly(1)},t.atLeastOnce=function(){return new t(function(t){return t>=1},1,255,t.NO_MATCHING_CALLS_AT_LEAST_ONCE)},t.atMostOnce=function(){return new t(function(t){return t>=0&&1>=t},0,1,t.NO_MATCHING_CALLS_AT_MOST_ONCE)},t}();n.NO_MATCHING_CALLS_EXACTLY_N_TIMES="expected invocation of <%= i %> <%= n %> times, invoked <%= m %> times",n.NO_MATCHING_CALLS_AT_LEAST_ONCE="expected invocation of <%= i %> at least once, invoked <%= m %> times",n.NO_MATCHING_CALLS_AT_MOST_ONCE="expected invocation of <%= i %> at most once, invoked <%= m %> times";var r,o=function(){function t(){}return t.getOwnEnumerables=function(t){return this._getPropertyNames(t,!0,!1,this._enumerable)},t.getOwnNonenumerables=function(t){return this._getPropertyNames(t,!0,!1,this._notEnumerable)},t.getOwnEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!0,!1,this._enumerableAndNotEnumerable)},t.getPrototypeEnumerables=function(t){return this._getPropertyNames(t,!1,!0,this._enumerable)},t.getPrototypeNonenumerables=function(t){return this._getPropertyNames(t,!1,!0,this._notEnumerable)},t.getPrototypeEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!1,!0,this._enumerableAndNotEnumerable)},t.getOwnAndPrototypeEnumerables=function(t){return this._getPropertyNames(t,!0,!0,this._enumerable)},t.getOwnAndPrototypeNonenumerables=function(t){return this._getPropertyNames(t,!0,!0,this._notEnumerable)},t.getOwnAndPrototypeEnumerablesAndNonenumerables=function(t){return this._getPropertyNames(t,!0,!0,this._enumerableAndNotEnumerable)},t._enumerable=function(t,e){return t.propertyIsEnumerable(e)},t._notEnumerable=function(t,e){return!t.propertyIsEnumerable(e)},t._enumerableAndNotEnumerable=function(t,e){return!0},t._getPropertyNames=function(t,n,r,o){var i=[];do{if(n)for(var u=Object.getOwnPropertyNames(t),c=function(n){var r=e.find(i,function(t){return t.name===n});if(!r&&o(t,n)){var u=Object.getOwnPropertyDescriptor(t,n);i.push({name:n,desc:u})}},a=0,s=u;a<s.length;a++){var p=s[a];c(p)}if(!r)break;n=!0}while(t=Object.getPrototypeOf(t));return i},t}(),i=function(){function t(){}return t.functionName=function(t){var e;if(t.name)e=t.name;else{var n=t.toString();n=n.substr("function ".length),e=n.substr(0,n.indexOf("("))}return e},t.objectName=function(e){var n=t.functionName(e.constructor);return n},t.argsName=function(t){var n=e.join(t);return n},t.conthunktor=function(t,e){var n=new(t.bind.apply(t,[void 0].concat(e)));return n},t.clone=function(t,e){for(var n=o.getOwnAndPrototypeEnumerablesAndNonenumerables(e),r=0,i=n;r<i.length;r++){var u=i[r];Object.defineProperty(t,u.name,u.desc)}},t}(),u=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),c=function(t){function e(n,r){var o=t.call(this,r)||this;return o.name=n,Object.setPrototypeOf(o,e.prototype),o}return u(e,t),e.prototype.toString=function(){var t=this.message?this.name+" - "+this.message:this.name;return t},e}(Error),a=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){t[t.NoSetup="no setup expression found for"]="NoSetup",t[t.MoreThanOneSetup="more than one setup expression found for"]="MoreThanOneSetup",t[t.InvalidSetup="invalid setup expression"]="InvalidSetup",t[t.InvalidMatcher="invalid matching expression"]="InvalidMatcher",t[t.InvalidProxyArg="invalid proxy argument"]="InvalidProxyArg",t[t.UnknownGlobalType="unknown global type"]="UnknownGlobalType",t[t.CallCountVerificationFailed="invocation count verification failed"]="CallCountVerificationFailed",t[t.CallOrderVerificationFailed="invocation order verification failed"]="CallOrderVerificationFailed",t[t.InvalidDynamicProxyRuntime="invalid dynamic proxy runtime"]="InvalidDynamicProxyRuntime"}(r||(r={}));var s=function(t){function e(n,r,o){void 0===o&&(o=void 0);var i=t.call(this,"MockException",o)||this;return i.reason=n,i.ctx=r,i.message=o,Object.setPrototypeOf(i,e.prototype),i}return a(e,t),e.prototype.toString=function(){var t=this.name+" - "+this.reason;return this.message&&(t=t+" ("+this.message+")"),t},e}(c),p=function(){function t(){}return t}();p.IMATCH_ID_VALUE="438A51D3-6864-49D7-A655-CA1153B86965",p.IMATCH_ID_NAME="___id",p.IMATCH_MATCHES_NAME="___matches",p.IPROXY_ID_VALUE="BCDF5CE5-F0DF-40B7-8BA0-69DF395033C8",p.IPROXY_ID_NAME="___id";var l,f=function(){function t(t){this._ctor=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!1;return t&&t.constructor.prototype==this._ctor.prototype&&(e=!0),e},t.prototype.toString=function(){var t="It.isAnyObject("+i.functionName(this._ctor)+")";return t},t}(),h=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!0;return e},t.prototype.toString=function(){return"It.isAny()"},t}(),y=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isString(t)&&(n=!0),n},t.prototype.toString=function(){return"It.isAnyString()"},t}(),_=function(){function t(){this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isNumber(t)&&(n=!0),n},t.prototype.toString=function(){return"It.isAnyNumber()"},t}(),d=function(){function t(t){this._pred=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var e=!1;return t&&this._pred(t)&&(e=!0),e},t.prototype.toString=function(){var t="It.is("+this._pred+")";return t},t}(),v=function(){function t(t){this._value=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1;return e.isEqual(this._value,t)&&(n=!0),n},t.prototype.toString=function(){var t="It.isValue("+this._value+")";return t},t}(),b=function(){function t(t){this._value=t,this.___id=p.IMATCH_ID_VALUE}return t.prototype.___matches=function(t){var n=!1,r=e.pick(t,e.keys(this._value));return e.isEqual(this._value,r)&&(n=!0),n},t.prototype.toString=function(){var t="It.isObjectWith("+this._value+")";return t},t}();!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.PROPERTY=1]="PROPERTY",t[t.FUNCTION=2]="FUNCTION"}(l||(l={}));var m;!function(t){t[t.STATIC=0]="STATIC",t[t.DYNAMIC=1]="DYNAMIC"}(m||(m={}));var g,C=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){t[t.NONE=0]="NONE",t[t.SETUP=1]="SETUP",t[t.EXECUTE=2]="EXECUTE"}(g||(g={}));var O,I=function(){function t(t,e){this.proxyType=t,this.callType=e,this.invocationType=g.NONE}return Object.defineProperty(t.prototype,"isAnUnknownDynamicCallAtExecution",{get:function(){return this.proxyType==m.DYNAMIC&&this.callType==l.UNKNOWN&&this.invocationType==g.EXECUTE},enumerable:!0,configurable:!0}),t}(),P=function(t){function e(e,n,r,o,i){void 0===o&&(o=m.STATIC),void 0===i&&(i=l.FUNCTION);var u=t.call(this,o,i)||this;return u._that=e,u._property=n,u._args=r,u}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args||{length:0,callee:null}},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){var t={};this._that?i.clone(t,this._that):t=this._property.obj,this.returnValue=this._property.toFunc.apply(t,this._args)},e.prototype.toString=function(){var t=this.property+"("+i.argsName(this.args)+")";return t},e}(I),w=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.PROPERTY);var i=t.call(this,r,o)||this;return i._property=e,i.value=n,i.returnValue=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){var t=[];return Object.defineProperty(t,"callee",{configurable:!0,enumerable:!0,writable:!1,value:null}),t},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=""+this.property;return t},e}(I),A=function(t){function e(e,n){var r=t.call(this,e,n,m.DYNAMIC,l.UNKNOWN)||this;return r.returnValue=n,r}return C(e,t),e}(w),x=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.PROPERTY);var i=t.call(this,r,o)||this;return i._property=e,i._args=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this._property.obj[this._property.name]=this._args[0],this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=this.property+" = "+i.argsName(this.args[0]);return t},e}(I),N=function(t){function e(e,n,r,o){void 0===r&&(r=m.STATIC),void 0===o&&(o=l.FUNCTION);var i=t.call(this,r,o)||this;return i._property=e,i._getter=n,i}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){var t=[];return Object.defineProperty(t,"callee",{configurable:!0,enumerable:!0,writable:!1,value:null}),t},set:function(t){},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=""+this.property;return t},e}(I),E=function(t){function e(e,n,r,o,i){void 0===o&&(o=m.STATIC),void 0===i&&(i=l.FUNCTION);var u=t.call(this,o,i)||this;return u._property=e,u._setter=n,u._args=r,u}return C(e,t),Object.defineProperty(e.prototype,"args",{get:function(){return this._args},set:function(t){this._args=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"property",{get:function(){return this._property},enumerable:!0,configurable:!0}),e.prototype.invokeBase=function(){this._property.obj[this._property.name]=this._args[0],this.returnValue=this._property.obj[this._property.name]},e.prototype.toString=function(){var t=this.property+"("+i.argsName(this.args[0])+")";return t},e}(I),T=function(){function t(t,e,n){this.obj=t,this.name=e,this.desc=n}return Object.defineProperty(t.prototype,"toFunc",{get:function(){var t;return t=e.isFunction(this.obj)?this.obj:this.obj[this.name]},enumerable:!0,configurable:!0}),t.prototype.toString=function(){var t=i.objectName(this.obj),e=t+"."+this.name;return e},t}(),j=function(){function t(t,e,n){this.obj=t,this.name=e,this.desc=n}return t.prototype.toString=function(){var t=i.objectName(this.obj),e=t+"."+this.name;return e},t}(),k=function(){function t(t,n){var r=this;this.___id=p.IPROXY_ID_VALUE,this.check(n);var i=this,u=o.getOwnAndPrototypeEnumerablesAndNonenumerables(n);e.each(u,function(o){if(e.isFunction(o.desc.value)){var u={configurable:o.desc.configurable,enumerable:o.desc.enumerable,writable:o.desc.writable};r.defineMethodProxy(i,t,n,o.name,u)}else{var u={configurable:o.desc.configurable,enumerable:o.desc.enumerable};void 0!==o.desc.value?r.defineValuePropertyProxy(i,t,n,o.name,o.desc.value,u):r.defineGetSetPropertyProxy(i,t,n,o.name,o.desc.get,o.desc.set,u)}})}return t.of=function(n,r){t.check(n);var o;if(e.isFunction(n)){var u=i.functionName(n);o=t.methodProxyValue(void 0,r,n,u,null)}else o=new t(r,n);return o},t.isProxy=function(t){return e.isNil(t)||e.isUndefined(t[p.IPROXY_ID_NAME])||t[p.IPROXY_ID_NAME]!==p.IPROXY_ID_VALUE?!1:!0},t.check=function(n){t.checkNotNullOrUndefined(n);var o=!1;if((e.isFunction(n)||e.isObject(n)&&!t.isPrimitiveObject(n))&&(o=!0),!o)throw new s(r.InvalidProxyArg,n,"'"+n+"'; argument should be a function or a non primitive object")},t.prototype.check=function(n){t.checkNotNullOrUndefined(n);var o=!1;if(e.isFunction(n)||!e.isObject(n)||t.isPrimitiveObject(n)||(o=!0),!o)throw new s(r.InvalidProxyArg,n,"'"+n+"'; argument should be a non primitive object")},t.checkNotNullOrUndefined=function(t){if(e.isNil(t))throw new s(r.InvalidProxyArg,t,"'"+t+"'; argument is required")},t.isPrimitiveObject=function(t){var n=!1;return(e.isFunction(t)||e.isArray(t)||e.isDate(t)||e.isNull(t))&&(n=!0),n},t.prototype.defineMethodProxy=function(e,n,r,o,i){void 0===i&&(i={configurable:!0,enumerable:!0,writable:!1}),i.value=t.methodProxyValue(e,n,r,o,i),this.defineProperty(e,o,i)},t.methodProxyValue=function(t,e,n,r,o){function i(){var i=new T(n,r,o),u=new P(t,i,arguments);return e.intercept(u),u.returnValue}return i},t.prototype.defineValuePropertyProxy=function(t,e,n,r,o,i){function u(){var t=new j(n,r),i=new w(t,o);return e.intercept(i),i.returnValue}function c(t){var o=new j(n,r),i=new x(o,arguments);e.intercept(i)}void 0===i&&(i={configurable:!0,enumerable:!0}),i.get=u,i.set=c,this.defineProperty(t,r,i)},t.prototype.defineGetSetPropertyProxy=function(t,e,n,r,o,i,u){function c(){var t=new j(n,r),i=new N(t,o);return e.intercept(i),i.returnValue}function a(t){var o=new j(n,r),u=new E(o,i,arguments);e.intercept(u)}void 0===u&&(u={configurable:!0,enumerable:!0}),u.get=c,u.set=a,this.defineProperty(t,r,u)},t.prototype.defineProperty=function(t,e,n){try{Object.defineProperty(t,e,n)}catch(r){console.log(r.message)}},t}(),S=function(){function t(t){this.___id=p.IPROXY_ID_VALUE;var e=new Proxy(function(){},t);return e}return t.of=function(e){t.check();var n=new t(e);return n},t.check=function(){if("undefined"==typeof Proxy)throw new s(r.InvalidDynamicProxyRuntime,null,"ES6 Proxy object not detected; the dynamic mocking feature requires ES6 Proxy object support")},t}(),M=function(){function t(t){this._interceptor=t}return t.prototype.apply=function(t,e,n){var r=i.functionName(t),o=new T(t,r),u=new P(t,o,n,m.DYNAMIC);return this._interceptor.intercept(u),u.returnValue},t.prototype.get=function(t,n,r){var o=this,i=t[n],u=new j(t,n),c=new A(u,i);return this._interceptor.intercept(c),!e.isFunction(i)&&c.callType==l.PROPERTY&&c.property.desc?c.returnValue:function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];o._interceptor.removeInvocation(c);var i=new T(t,n),u=new P(t,i,e,m.DYNAMIC);return o._interceptor.intercept(u),u.returnValue}},t.prototype.set=function(t,e,n,r){var o=new j(t,e),i=new x(o,[n],m.DYNAMIC);return this._interceptor.intercept(i),Reflect.set(t,e,n,r)},t.prototype.defineProperty=function(t,e,n){return n.configurable=!0,Reflect.defineProperty(t,e,n)},t}(),V=function(){function t(){}return t.createProxy=function(t,e){var n=k.of(e,t);return n},t.createProxyES6=function(t){var e=new M(t),n=S.of(e);return n},t}(),D=function(){function n(e,n,r){void 0===r&&(r=t.MockBehavior.Loose),this.targetInstance=e,this.canOverrideTarget=n,this.behavior=r,this._id=this.generateId(),this._name=this.getNameOf(this.targetInstance)}return Object.defineProperty(n.prototype,"object",{get:function(){return this._proxy},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"callBase",{get:function(){return this._callBase},set:function(t){this._callBase=t},enumerable:!0,configurable:!0}),n.prototype.generateId=function(){return"Mock<"+e.uniqueId()+">"},n.prototype.getNameOf=function(t){var n;if(e.isFunction(t))n=i.functionName(t);else if(e.isObject(t)){var r=t.constructor;n=i.functionName(r)}return n&&(n=n.trim()),n},n.prototype.verifyAll=function(){try{this._interceptor.verify()}catch(t){throw t}},n.prototype.reset=function(){this._interceptor.reset()},n}();!function(t){t[t.Continue=0]="Continue",t[t.Stop=1]="Stop"}(O||(O={}));var U,L=function(){function t(t){this.mock=t,this._actualInvocations=[],this._expectedCalls=[]}return Object.defineProperty(t.prototype,"behavior",{get:function(){return this.mock.behavior},enumerable:!0,configurable:!0}),t.prototype.addInvocation=function(t){this._actualInvocations.push(t)},t.prototype.removeInvocation=function(t){e.remove(this._actualInvocations,function(e){return e===t})},t.prototype.actualInvocations=function(){return this._actualInvocations},t.prototype.clearInvocations=function(){this._actualInvocations.splice(0,this._actualInvocations.length)},t.prototype.addExpectedCall=function(t){this._expectedCalls.push(t)},t.prototype.removeExpectedCall=function(t){e.filter(this._expectedCalls,function(e){return e.id!==t.id})},t.prototype.expectedCalls=function(){return this._expectedCalls},t.prototype.clearExpectedCalls=function(){this._expectedCalls.splice(0,this._expectedCalls.length)},t.prototype.reset=function(){this.clearInvocations(),this.clearExpectedCalls()},t}(),F=function(){function t(){}return t}(),B=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return e.addInvocation(t),O.Continue},t}(),R=function(){function n(){}return n.prototype.handleIntercept=function(n,o,i){var u=o.expectedCalls().slice(),c=function(t){return t.matches(n)},a=e.filter(u,function(t){return c(t)});if(a.length>1&&(c=function(t){return!t.isInvoked&&t.matches(n)}),i.call=e.find(u,function(t){return c(t)}),null!=i.call){if(n.isAnUnknownDynamicCallAtExecution&&(n.callType=i.call.setupCall.callType,n.callType==l.FUNCTION))return O.Stop;i.call.evaluatedSuccessfully()}else if(o.behavior==t.MockBehavior.Strict)throw new s(r.NoSetup,n,"'"+n+"'");return O.Continue},n}(),Y=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){this._ctx=e;var r=n.call;return null!=r?(r.execute(t),O.Stop):O.Continue},t}(),H=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return e.mock.callBase?(t.invokeBase(),O.Stop):O.Continue},t}(),G=function(){function t(){}return t.prototype.handleIntercept=function(t,e,n){return O.Continue},t}(),q=function(){function t(t){this._interceptorContext=new L(t)}return Object.defineProperty(t.prototype,"interceptorContext",{get:function(){return this._interceptorContext},enumerable:!0,configurable:!0}),t.prototype.intercept=function(t){var n=this,r=new F;t.invocationType=g.EXECUTE,e.some(this.interceptionStrategies(),function(e){return O.Stop===e.handleIntercept(t,n.interceptorContext,r)?!0:void 0})},t.prototype.removeInvocation=function(t){this._interceptorContext.removeInvocation(t)},t.prototype.addExpectedCall=function(t){this._interceptorContext.addExpectedCall(t)},t.prototype.verify=function(){for(var t=this._interceptorContext.expectedCalls(),n=e.filter(t,function(t){return t.isVerifiable}),r=0,o=n;r<o.length;r++){var i=o[r];this.verifyCallCount(i,i.expectedCallCount)}var u=e.filter(t,function(t){return t.isInSequence});this.verifyCallsOrder(u)},t.prototype.verifyCallCount=function(t,n){var r=this._interceptorContext.actualInvocations(),o=e.filter(r,function(e){return t.matches(e)}).length;n.verify(o)||this.throwVerifyCallCountException(t.setupCall,n)},t.prototype.throwVerifyCallCountException=function(t,e){var n=new s(r.CallCountVerificationFailed,t,e.failMessage(t));throw n},t.prototype.verifyCallsOrder=function(t){var e=this._interceptorContext.actualInvocations();this.checkCallOrderExpectations(t,e)},t.prototype.checkCallOrderExpectations=function(t,n){var r=function(r){for(var o=e.sum(r),i=0,u=0;u<r.length;u++)for(var c=t[u],a=r[u],s=1;a>=s;s++){var p=n[i++];if(!c.matches(p))return!1}return i===o},o=!1,i=function(e,n){if(!o)if(n===t.length)o=r(e);else for(var u=t[n].expectedCallCount.min;u<=t[n].expectedCallCount.max;u++)e[n]=u,i(e,n+1)};i([],0),o||this.throwVerifyCallOrderException()},t.prototype.throwVerifyCallOrderException=function(){var t=new s(r.CallOrderVerificationFailed,null);throw t},t.prototype.reset=function(){this._interceptorContext.reset()},t.prototype.interceptionStrategies=function(){var t=[new B,new R,new Y,new H,new G];return t},t}(),X=function(){function t(){}return Object.defineProperty(t.prototype,"interceptedCall",{get:function(){return this._interceptedCall},enumerable:!0,configurable:!0}),t.prototype.intercept=function(t){if(t.invocationType=g.SETUP,t.proxyType==m.DYNAMIC&&t.callType==l.UNKNOWN&&(t.callType=l.PROPERTY),this._interceptedCall)throw new s(r.MoreThanOneSetup,t,"'"+t+"'; setup should contain only one expression");this._interceptedCall=t},t.prototype.removeInvocation=function(t){this._interceptedCall&&this._interceptedCall===t&&(this._interceptedCall=void 0)},t}(),W=function(){function o(t,e,n,o){if(this.mock=t,this._setupExpression=e,this._callCount=0,this._id=this.generateId(),e(o),!n.interceptedCall)throw new s(r.InvalidSetup,this._setupExpression,"'"+this._setupExpression+"'");var i=n.interceptedCall,u=this.transformToMatchers(i.args);Object.defineProperty(u,"callee",{configurable:!0,enumerable:!0,writable:!1,value:i.args.callee}),i.args=u,this._setupCall=i}return o.ofStaticMock=function(t,e){var n=new X,r=V.createProxy(n,t.targetInstance),i=new o(t,e,n,r);return i},o.ofDynamicMock=function(t,e){var n=new X,r=V.createProxyES6(n),i=new o(t,e,n,r);return i},o.prototype.generateId=function(){return"MethodCall<"+e.uniqueId()+">"},o.prototype.transformToMatchers=function(t){var n=[];return e.each(t,function(t){if(e.isObject(t))if(e.isUndefined(t[p.IMATCH_MATCHES_NAME])||e.isUndefined(t[p.IMATCH_ID_NAME])||t[p.IMATCH_ID_NAME]!==p.IMATCH_ID_VALUE){var r=new d(function(e){return e===t});n.push(r)}else n.push(t);else{var r=new v(t);n.push(r)}}),n},Object.defineProperty(o.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"setupExpression",{get:function(){return this._setupExpression},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"setupCall",{get:function(){return this._setupCall},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isVerifiable",{get:function(){return this._isVerifiable},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isInSequence",{get:function(){return this._expectedCallType===t.ExpectedCallType.InSequence},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"expectedCallCount",{get:function(){return this._expectedCallCount},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isInvoked",{get:function(){return this._isInvoked},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"callCount",{get:function(){return this._callCount},enumerable:!0,configurable:!0}),o.prototype.evaluatedSuccessfully=function(){this._evaluatedSuccessfully=!0},o.prototype.matches=function(t){var n=!1;return this._setupCall.property&&t&&t.property&&this._setupCall.property.name===t.property.name&&this._setupCall.args.length>=t.args.length&&(n=!0,t.isAnUnknownDynamicCallAtExecution||e.each(this._setupCall.args,function(e,r){var o=e,i=t.args[r];n&&!o.___matches(i)&&(n=!1)})),n},o.prototype.execute=function(t){if(this._isInvoked=!0,null!=this._setupCallback&&this._setupCallback.apply(this,t.args),null!=this._thrownException)throw this._thrownException;this._callCount++},o.prototype.verifiable=function(e,r){void 0===e&&(e=n.atLeastOnce()),void 0===r&&(r=t.ExpectedCallType.InAnyOrder),this._isVerifiable=!0,this._expectedCallCount=e,this._expectedCallType=r},o}(),K=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),z=function(t){function e(e,n,r,o){var i=t.call(this,e,n,r,o)||this;return i._overrideTarget=e.canOverrideTarget,i}return K(e,t),e.ofStaticMock=function(t,n){var r=new X,o=V.createProxy(r,t.targetInstance),i=new e(t,n,r,o);return i},e.ofDynamicMock=function(t,n){var r=new X,o=V.createProxyES6(r),i=new e(t,n,r,o);return i},e.prototype.execute=function(e){t.prototype.execute.call(this,e),this._callBase?e.invokeBase():this.hasReturnValue&&(e.returnValue=this._returnValueFunc.apply(this,e.args),e.property.desc={value:this.setupCall.property.desc&&this.setupCall.property.desc.value})},e.prototype.callback=function(t){return this._setupCallback=t,this},e.prototype["throws"]=function(t){return this._thrownException=t,this},e.prototype.returns=function(t){if(this._returnValueFunc=t,this.hasReturnValue=!0,this._overrideTarget){var e=this.mock.targetInstance,n=this.setupCall.property.name,r=this.setupCall.property.desc;r&&(r.configurable=!0,r.enumerable=!0,r.value=this._returnValueFunc,Object.defineProperty(e,n,r))}return this},e.prototype.callBase=function(){return this._callBase=!0,this},e}(W),J=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Q=function(t){function n(e,n,r){var o=t.call(this,e,n,r)||this;return o._interceptor=new q(o),o._proxy=V.createProxy(o._interceptor,e),o}return J(n,t),n.ofInstance=function(t,e){t=n.cloneDeep(t);var r=new n(t,!0,e);return r},n.ofGlobalInstance=function(t,e){var r=new n(t,!1,e);return r},n.ofType=function(t,e,r){var o=i.conthunktor(t,r),u=new n(o,!0,e);return u},n.cloneDeep=function(t){var n=t;if(!e.isFunction(t)){var r=function(t){return k.isProxy(t)?t:void 0};n=e.cloneDeepWith(t,r)}return n},n.prototype.setup=function(t){var e=z.ofStaticMock(this,t);return this._interceptor.addExpectedCall(e),e},n.prototype.verify=function(t,e){var n=W.ofStaticMock(this,t);this._interceptor.addExpectedCall(n);try{this._interceptor.verifyCallCount(n,e)}catch(r){throw r}},n}(D),Z=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$=function(t){function e(e,n,r){var o=t.call(this,{},n,r)||this;return e&&(o._name=e),o._interceptor=new q(o),o._proxy=V.createProxyES6(o._interceptor),o}return Z(e,t),e.ofType=function(t,n){var r=new e(t,!0,n);return r},e.prototype.setup=function(t){var e=z.ofDynamicMock(this,t);return this._interceptor.addExpectedCall(e),e},e.prototype.verify=function(t,e){var n=W.ofDynamicMock(this,t);this._interceptor.addExpectedCall(n);try{this._interceptor.verifyCallCount(n,e)}catch(r){throw r}},e}(D),tt=function(){function e(){}return e.ofInstance=function(e,n){void 0===n&&(n=t.MockBehavior.Loose);var r=Q.ofInstance(e,n);return r},e.ofType=function(n,r){void 0===r&&(r=t.MockBehavior.Loose);for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var u;return u=n?e.ofType2(n,o,r):$.ofType(void 0,r)},e.ofType2=function(e,n,r){void 0===r&&(r=t.MockBehavior.Loose);var o=Q.ofType(e,r,n);return o},e}(),et=function(){function t(){}return t.isValue=function(t){var e=new v(t);return e},t.isObjectWith=function(t){var e=new b(t);return e},t.isAnyObject=function(t){var e=new f(t);return e},t.isAny=function(){var t=new h;return t},t.isAnyString=function(){var t=new y;return t},t.isAnyNumber=function(){var t=new _;return t},t.is=function(t){var e=new d(t);return e},t}();!function(t){t[t.Class=0]="Class",t[t.Function=1]="Function",t[t.Value=2]="Value"}(U||(U={}));var nt=function(){function t(t,e,n,r){this.mock=t,this._name=e,this._type=n,this.container=r,this._name||(this._name=t.name)}return Object.defineProperty(t.prototype,"object",{get:function(){return this.mock.object},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name||this.mock.name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"behavior",{get:function(){return this.mock.behavior},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"callBase",{get:function(){return this.mock.callBase},set:function(t){this.mock.callBase=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),t.prototype.setup=function(t){return this.mock.setup(t)},t.prototype.verify=function(t,e){this.mock.verify(t,e)},t.prototype.verifyAll=function(){this.mock.verifyAll()},t.prototype.reset=function(){this.mock.reset()},t}(),rt=function(){function n(){}return n.ofInstance=function(n,r,o,i){void 0===o&&(o=window),void 0===i&&(i=t.MockBehavior.Loose);var u=Q.ofGlobalInstance(n,i),c=e.isFunction(n)?U.Function:U.Value;return new nt(u,r,c,o)},n.ofType=function(e,n,r){void 0===n&&(n=window),void 0===r&&(r=t.MockBehavior.Loose);var o=new e,i=Q.ofInstance(o,r);return new nt(i,void 0,U.Class,n)},n.ofType2=function(e,n,r){void 0===n&&(n=window),void 0===r&&(r=t.MockBehavior.Loose);var o=$.ofType(e,r);return new nt(o,void 0,U.Class,n)},n}(),ot=function(){function t(t){this._args=t}return t.prototype["with"]=function(t){var n={};try{e.each(this._args,function(t){var i=o.getOwnAndPrototypeEnumerablesAndNonenumerables(t.container),u=e.find(i,function(e){return e.name===t.name});if(u){n[t.name]=u.desc;var c={};switch(t.type){case U.Class:c.value=function(){return t.mock.object};break;case U.Function:c.value=t.mock.object;break;case U.Value:c.get=function(){return t.mock.object};break;default:throw new s(r.UnknownGlobalType,t,"unknown global type: "+t.type)}try{Object.defineProperty(t.container,t.name,c)}catch(a){console.log("1: "+a)}}}),t.apply(this,this._args)}catch(i){console.log("2: "+i)}finally{e.each(this._args,function(t){var e=n[t.name];if(e){switch(t.type){case U.Class:break;case U.Function:break;case U.Value:e.configurable=!0}try{Object.defineProperty(t.container,t.name,e)}catch(r){console.log("3: "+r)}}})}},t}(),it=function(){function t(){}return t.using=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new ot(t);return n},t}();t.Mock=tt,t.It=et,t.Times=n,t.GlobalMock=rt,t.GlobalScope=it,t.MockException=s,Object.defineProperty(t,"__esModule",{value:!0})});

@@ -400,2 +400,3 @@ // Generated by dts-bundle v0.7.2

proxyType: ProxyType;
isAnUnknownDynamicCallAtExecution: boolean;
}

@@ -429,2 +430,3 @@ }

abstract invokeBase(): void;
readonly isAnUnknownDynamicCallAtExecution: boolean;
}

@@ -431,0 +433,0 @@ export class MethodInvocation extends BaseInvocation {

{
"name": "typemoq",
"version": "1.4.1",
"version": "1.4.2",
"description": "A simple mocking library for TypeScript",

@@ -5,0 +5,0 @@ "author": "Florin Nitoi <florin.nitoi@gmail.com>",

@@ -35,5 +35,3 @@ import * as _ from "lodash";

// determine call type for dynamic mock at execution
if (invocation.proxyType == all.ProxyType.DYNAMIC &&
invocation.callType == all.CallType.UNKNOWN &&
invocation.invocationType == all.InvocationType.EXECUTE) {
if (invocation.isAnUnknownDynamicCallAtExecution) {

@@ -40,0 +38,0 @@ invocation.callType = localCtx.call.setupCall.callType;

@@ -21,7 +21,7 @@ import * as _ from "lodash";

protected constructor(
public mock: MockBase<T>,
public mock: MockBase<T>,
private _setupExpression: all.IFunc2<T, TResult>,
interceptor: InterceptorSetup<T>,
proxy: T) {
this._id = this.generateId();

@@ -51,3 +51,3 @@

let result = new MethodCall(mock, setupExpression, interceptor, proxy);
return result;
return result;
}

@@ -113,9 +113,13 @@

match = true;
_.each(this._setupCall.args, (x: any, index: number) => {
let setupArg = <all.IMatch>x;
let callArg = call.args[index];
if (match && !setupArg.___matches(callArg))
match = false;
});
if (!call.isAnUnknownDynamicCallAtExecution) {
_.each(this._setupCall.args, (x: any, index: number) => {
let setupArg = <all.IMatch>x;
let callArg = call.args[index];
if (match && !setupArg.___matches(callArg))
match = false;
});
}
}

@@ -144,5 +148,5 @@ }

verifiable(
times: all.Times = all.Times.atLeastOnce(),
times: all.Times = all.Times.atLeastOnce(),
expectedCallType: all.ExpectedCallType = all.ExpectedCallType.InAnyOrder): void {
this._isVerifiable = true;

@@ -149,0 +153,0 @@ this._expectedCallCount = times;

@@ -19,2 +19,3 @@ import { IPropertyInfo, InvocationType } from "./Invocation";

proxyType: ProxyType;
}
isAnUnknownDynamicCallAtExecution: boolean;
}

@@ -23,2 +23,8 @@ import * as _ from "lodash";

abstract invokeBase(): void;
get isAnUnknownDynamicCallAtExecution(): boolean {
return this.proxyType == ProxyType.DYNAMIC &&
this.callType == CallType.UNKNOWN &&
this.invocationType == InvocationType.EXECUTE;
};
}

@@ -28,4 +34,4 @@

constructor(
private readonly _that: Object,
private readonly _property: MethodInfo,
private readonly _that: Object,
private readonly _property: MethodInfo,
private _args?: IArguments,

@@ -59,3 +65,3 @@ proxyType = ProxyType.STATIC,

constructor(
private readonly _property: IPropertyInfo,
private readonly _property: IPropertyInfo,
readonly value: any,

@@ -99,3 +105,3 @@ proxyType = ProxyType.STATIC,

constructor(
private readonly _property: IPropertyInfo,
private readonly _property: IPropertyInfo,
private _args: IArguments,

@@ -125,3 +131,3 @@ proxyType = ProxyType.STATIC,

constructor(
private readonly _property: IPropertyInfo,
private readonly _property: IPropertyInfo,
private readonly _getter: () => any,

@@ -155,4 +161,4 @@ proxyType = ProxyType.STATIC,

constructor(
private readonly _property: IPropertyInfo,
private readonly _setter: (v: any) => void,
private readonly _property: IPropertyInfo,
private readonly _setter: (v: any) => void,
private _args: IArguments,

@@ -182,4 +188,4 @@ proxyType = ProxyType.STATIC,

constructor(
public readonly obj: any,
public readonly name: string,
public readonly obj: any,
public readonly name: string,
public readonly desc?: common.PropDescriptor) {

@@ -206,4 +212,4 @@ }

constructor(
public readonly obj: Object,
public readonly name: string,
public readonly obj: Object,
public readonly name: string,
public readonly desc?: common.PropDescriptor) {

@@ -210,0 +216,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc