O'Reilly logo

Mastering Microsoft Dynamics AX 2012 R3 Programming by Mat Fergusson, Simon Buxton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating unit tests with data isolation

In this instance, our test case will create data that will used to test that the records are inserted correctly and the methods perform the correct behavior.

The test will be to create a number of vehicle service records and test the validateField, modifiedField, and insert methods. We also want to test creating a number of these records to test performance of this table.

The steps involved in this scenario are the same as before, except that we need to tear down the data we created. We will also see that a test case can actually contain far more code than the code that we are testing. This is normal, and we expect to see a 3:1 ratio of test code to business logic.

The framework supports automatic teardown ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required