-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
For classes that extend Proxy Mockolate should intercept all the flash_proxy methods in order to allow use of expect().
Currently users have to do this:
mock(proxyObject).nsMethod(flash_proxy, "callProperty").args("actualMethodName", arg1, arg2).returns(result);
mock(proxyObject).nsMethod(flash_proxy, "getProperty").args("actualPropertyName", arg1, arg2).returns(result);
mock(proxyObject).nsMethod(flash_proxy, "setProperty").args("actualPropertyName", value);
mock(proxyObject).nsMethod(flash_proxy, "hasProperty").args("actualPropertyName").returns(true);When they should be able to do this:
expect(proxyObject.actualMethodName(arg1, arg2)).returns(result);
expect(proxyObject.actualPropertyName).returns(result);
expect(proxyObject.actualPropertyName = value).returns(result);
expect("actualPropertyName" in proxyObject).returns(true);Support for property access should also be added.
expect(proxyObject[0]).returns(indexValue);
expect(proxyObject["propertyName"]).returns(propertyvalue);Support for property iteration should also be added.
mock(proxyObject).asProxy().withItems([ 1, 2, 3 ]);
for each (var item:* in proxyObject) { ... }mock(proxyObject).asProxy().withProperties({ one: 1, two: 2, three: 3 });
for (var key:* in proxyObject) {
var value:* = proxyObject[key];
}Metadata
Metadata
Assignees
Labels
No labels