문제

While unit testing in actionscript-3 with mockolate I have run into quite a few problems/errors:

Error: No Expectation defined for Invocation:[FloxyInvocation invocationType=GETTER name="propertyName" arguments=[]]

Error: 1 unmet Expectation

Mockolate errors and debugging are poorly documented and searches bring up no results, so solving these problems get very tricky.

도움이 되었습니까?

해결책

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;
    }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top