My favorites | Sign in
Project Logo
                
Code license: New BSD License
Labels: as3, flash, flex, actionscript, mock, tdd
People details
Project owners:
  firstbourne

Create 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.









Hosted by Google Code