No expectation defined error is thrown when the function you are testing expects the specified invocation type and name:
Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]
Can be solved with:
mock(object).getter("propertyName").returns(someValue);
Unmet expectation error can be thrown when you created a mock statement (a getter
or setter
) but there is no getter
or setter
defined for the variable you are getting
or setting
.
Error: 1 unmet Expectation
Can be solved with:
public function get variable():String {
return _variable;
}
public function set variable(value:String):void {
_variable = value;
}