Create and use a mock
masterTo create a mock, use the mock() function with the class or type you want to mock. To get a usable instance of that mock to pass into your application code, use the instance() function. This allows you to control the behavior of the object and verify how it is used.
// Creating mock
let mockedFoo:Foo = mock(Foo);
// Getting instance from mock
let foo:Foo = instance(mockedFoo);
// Using instance in source code
foo.getBar(3);
foo.getBar(5);
// Explicit, readable verification
verify(mockedFoo.getBar(3)).called();
verify(mockedFoo.getBar(anything())).called();