Version 2

Rating: No reviews yet
Downloads: 70
Released: Apr 29, 2011
Updated: Apr 29, 2011 by JesperJensen
Dev status: Stable Help Icon

Downloads

Source Code AxUnit 2.zip
source code, 60K, uploaded Apr 29, 2011 - 70 downloads

Release Notes

AxUnit is a unit testing framework for use with Microsoft Dynamics Ax.

Version 2 adds
  1. A complete mocking framework which automatically generate a mock for a class or interface and let you easily set up expectations on the mock object using a simle syntax optimized for readability.
  2. Assertions are now done using Matchers allowing for easy composable and readable tests.
public void testDispatchMails()
{
    MailServer     fakeMailServer;
    MailDispatcher mailDispatcher;
    ;

    //Set up expectations
    fakeMailServer = expect.newFakeFor(classnum(MailServer));
    expect.on(fakeMailServer)
          .oneCallTo(fakeMailServer.sendMail(with.aStringThat(_.contains('@')), //Use Matchers _. to match a string that contains '@'
                                             with.aString()))
          .thenIt(will.return(true));

    mailDispatcher = new MailDispatcher(fakeMailServer);
    mailDispatcher.dispatchMails();

    assert.thatExpectationsAreSatisfied();
}
The mocking framework and matchers are inspired by the JMock framework and Hamcrest Matchers

Reviews for this release

No reviews yet for this release.