![]() |
#1 |
Участник
|
gatesasbait: Automated DAX test cases
Источник: http://gatesasbait.spaces.live.com/B...B9F5!144.entry
============== Good morning, During an MDIS webEx on Wednesday Microsoft specified new testing requirements for ISV's Dynamics Ax 5.0 MDIS modules. Microsoft will now require delivery of code for automated testing of 50% of test scenarios submitted to them (though what that means exactly is still anyone's guess). So today, I will give a very quick overview of the DAX test case framework. To create a test project, right click on the 'shared projects' node and select 'new test project'. A test project consists of test classes that extend 'SysTestCase'. A test class is required to be named 'test'+'name of class or table tested'. Methods need to be named 'test'+'name of method to be tested'. To run a 'test project', right click on the project, select 'add-ins - run tests'. Here is a quick example: (it's really easy to figure out what it does) public class AxSalesTableTest extends SysTestCase { } public void testParmCustGroup() { #define.testStr("testStr") AxSalesTable axSalesTable; /* * You might need to insert records in the database to test * some code or business logic. */ void setUp() { ; axSalesTable = AxSalesTable::construct(); } /* * If you inserted records, you must remove them as well as * any by-products of your testing. */ void tearDown() { ; } ; try { setUp(); //Code to test axSalesTable.parmCustGroup(#testStr); //Validation this.assertEquals(#testStr, axSalesTable.salesTable().CustGroup); } catch { tearDown(); throw error("Unable to test."); } tearDown(); } ![]() ![]() Источник: http://gatesasbait.spaces.live.com/B...B9F5!144.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|