Closed drewbourne closed 13 years ago
I tried this, and my function was never called. This resulted in "TypeError: Error #2007: Parameter type must be non-null."
I have the most recent version of Mockolate. Is this planned functionality, or is this supposed to be in there now?
I haven't yet implemented this feature.
You can pass constructor arguments manually using nice()
, strict()
or partial()
like so:
var example1:Example = nice(Example, "example1", [ arg1, arg2 ]); var example2:Example = strict(Example, "example2", [ arg1, arg2 ]); var example3:Example = partial(Example, "example3", [ arg1, arg2 ]);
Pushed to master.
Implemented as:
[Mock(args="argsAsField")]
public var target1:ClassWithConstructorArgs;
public var argsAsField:Array = [ true ];
[Mock(args="argsAsFunction")]
public var target2:ClassWithConstructorArgs;
public function argsAsFunction():Array {
return [ true ];
}
For vars marked with
[Mock]
if there is aconstructorArgs
attribute, try calling resolving and calling a function with the same name on the current test case to get the array of parameters to pass to the constructor.