在进行单元测试时actionscript-3,mockolate我遇到了很多问题/错误:
Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]
Error: 1 unmet Expectation
Mockolate 错误和调试的文档记录很差,搜索也没有结果,因此解决这些问题变得非常棘手。
在进行单元测试时actionscript-3,mockolate我遇到了很多问题/错误:
Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]
Error: 1 unmet Expectation
Mockolate 错误和调试的文档记录很差,搜索也没有结果,因此解决这些问题变得非常棘手。
当您正在测试的函数需要指定的调用类型和名称时,不会引发预期定义错误:
Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]
可以通过以下方式解决:
mock(object).getter("propertyName").returns(someValue);
当您创建模拟语句(agetter或setter)但没有getter或setter为变量定义时,可能会引发未满足的期望错误 you are gettingor setting。
Error: 1 unmet Expectation
可以通过以下方式解决:
public function get variable():String {
return _variable;
}
public function set variable(value:String):void {
_variable = value;
}