Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 可以使用mockito flex模拟getter和setter吗?_Apache Flex_Mockito_Setter_Getter - Fatal编程技术网

Apache flex 可以使用mockito flex模拟getter和setter吗?

Apache flex 可以使用mockito flex模拟getter和setter吗?,apache-flex,mockito,setter,getter,Apache Flex,Mockito,Setter,Getter,需要知道mockitoflex是否支持mocking getter和setter。谢谢。是的。只要被模拟的类和getter/setter方法是非final的,就可以模拟getter和setter。是。下面是一个例子: _mockFixedList = mock(IFixedList); var len:int = 10; given(_mockFixedList.length).willReturn(len); IFixedList的位置 function get length():int;

需要知道mockitoflex是否支持mocking getter和setter。谢谢。

是的。只要被模拟的类和getter/setter方法是非final的,就可以模拟getter和setter。

是。下面是一个例子:

 _mockFixedList = mock(IFixedList);
var len:int = 10;
given(_mockFixedList.length).willReturn(len);
IFixedList的位置

function get length():int;
然后

将跟踪'len='+10

trace('len=' + len);