Views:

Overview

This article explains how to create Test Data for a single entity. Test Data needs to be set up before you can build any Tests with TestShield. It is very easy to create as it is based on existing records within your Dynamics 365 CE/Dataverse system.

Prerequisites

To follow the steps in this article you will need to have installed and configured the North52 Calculator Demo solution and created a Calculation record.

Create Test Data

Set up

  • Open the North52 Decision Suite app
  • Navigate to TestShield > Test Data
  • Click New
  • Change the Name to Test Data - Calculator
  • Expand the form header editor and add a Category and Sub Category
    • For Category enter Calculator
    • For Sub Category enter Calculations
  • Click Save

Add Test Data

For our Test Data we are going to use the record that was created as part of the testing when installing the Calculator Demo solution.

  • Select the Explore tab
  • From the entity drop down list, select Calculation (note if the calculation entity is not displayed you will need to refresh the North52 cache - select Commands > Refresh from the menu at the top of the North52 Test Data editor, and then reload your browser window)
  • Expand the Test Calculation record (if you don't have a record, go to the App and create one)
    • Expand the (Attributes) node
    • Check the attributes Operator {Value}, Value One and Value Two 
  • Scroll back up and check the Test Calculation record under the Records tree node
  • Click the lightning bolt icon to add the selected record's values to a Calculation entity sheet:
    • Notes for adding Test Data:
      • Only the selected fields (attributes) which have data are added to the sheet. If you wanted all fields with data to be added do not select any specific attributes. 
      • The entity's Primary Field (in this example the Name field) is always added in column A and the Record's GUID is added in column B
      • The name has ' + {N52 - BaseTestID} + '-Calculation-Row-0004' automatically added. This is so that when data is generated as part of a Test, each new record created as part of the test will have a unique name corresponding to the test run for easy reference
      • The GUID's in column B are used to maintain record relationships when adding test data for related entities, however they are ignored when creating records as part of a test - hence the Exclude naming in row 1 of the column
  • Our Test Data at this stage will only create one Calculation record, however, we need to create four records to test each of the operators for our Calculator App:
    • Select cells A4 to E4
    • Position the cursor over the bottom right corner of cell E4, so that it changes to the Excel-like fill handle (+)
    • Drag down to E7
    • There are now four rows which will create four records when the test executes, however we need to updated the Name values and the Operator values to represent the Add, Subtract, Multiply and Divide options:
      • Name Values:
        • Edit cell A5 (press F2 as a shortcut to go into cell edit mode), changing the text Row-0004 to Row-0005
        • Edit cell A6, changing the text Row-0004 to Row-0006
        • Edit cell A7, changing the text Row-0004 to Row-0007
      • Operator Values:
        • Select cell C4 and press F2 to change the cell's edit mode. As this column represents data in an Option Set, the Option Set values are now available select. 
          • Select Add
          • Press F2 again to change out of edit mode and the cell's contents will be changed to {Add}
        • Select cell C5 and press F2
          • Select Subtract
          • Press F2 again to change out of edit mode and the cell's contents will be changed to {Subtract}
        • Select cell C6 and press F2
          • Select Multiply
          • Press F2 again to change out of edit mode and the cell's contents will be changed to {Multiply}
        • Select cell C7 and press F2
          • Select Divide
          • Press F2 again to change out of edit mode and the cell's contents will be changed to {Divide}
  • Click Save
    ​​​​​​​

Your Test Data is now ready to be used when configuring Tests.