|
Project Information
Members
Featured
Wiki pages
Links
|
NOTEmock-as3 is no longer actively maintained. MOCKOLATEUse Mockolate for the latest developments in mocks, stubs, and test spies for ActionScript 3. READMECreate flexible mock objects for use when unit testing Flash and Flex projects. Supports method and property mocking with argument constraints, return values, event dispatch, error throwing, and more. mock-as3 provides an expectation based API, allowing the setting of method and property expectations separate to the invocation of mocked methods. Just a taster of what mock-as3 looks like. // create an instance of a Mock delegate.
var example:MockExample = new MockExample();
// get the reference to the Mock instance.
var mock:Mock = example.mock;
// set an expectation
mock.method('hello').withArgs(String).andReturn('hi!').once;
// call the method
mock.hello('with a string');
// check that all the expectations were met
mock.verify();See the SettingExpectations page for more examples. |