![]() In this procedure, you will create another class named EmployeeTest that extends the SysTestCase Class class. For more information on attributes, see How to: Categorize Test Cases Using Attributes. You can provide additional information by attaching attributes. Use the same name as the class that you are testing followed by Test. When you create a test case you will create a class that must use the naming convention best practice to associate the test with the class you are testing. Right-click Class1, click Rename and then rename the class Employee. The Classes node expands with a new class that has a name such as Class1. In the AOT, right-click the Classes node and click New Class. Press CTRL+D to open the Application Object Tree (AOT). Open a Microsoft Dynamics AX development workspace. To continue with fewer compile errors you will create a stub for the Employee class that does not contain any feature logic. To abide by the principles of TDD, you will create the test class before you create the logic for the Employee class. ![]() To complete this walkthrough, you will need:Ī license file that has access to the MorphX development environment This walkthrough illustrates the following tasks:Īdding a test case for the name requirement.Īdding a test case for the retire requirement. The method can only be called one time per employee. The Employee class has a retire method that is called when the employee retires. When an instance of an Employee class is created, the name is set using the name method. The requirements for the Employee class include the following: After you create and run the test case, you will view the code coverage and set the isolation level for the test case. The following steps mention the TDD process but the goal is to emphasize the Unit Test framework. TDD advises that you have a failing test case and then write the feature code to satisfy the requirement that enables the test case to pass. For more information about TDD, see Guidelines for Test-Driven Development. The Unit Test framework is based on the principles of Test-Driven Development (TDD). You will also create a test case that verifies that the requirements for the class have been met. In this walkthrough, you will create an Employee class that satisfies specific requirements. Microsoft Dynamics AX includes a framework for creating, running, and analyzing unit tests. Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |