typemoq
typemoq copied to clipboard
cause error when argument don't have a default constructor
I mocked a method which is called with a argument don't have a default constructor. in MethodInvocation's constructor
if (args) {
this._args = <any>_.cloneDeep(args);
this._args.length = args.length;
this._args.callee = args.callee;
}
and then cause my application throw error.
So why cloneDeep the arguments? Is there any workaround in this case?