Skip to content

Commit

Permalink
Update Data-Driven-Tests.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alelom authored Oct 26, 2023
1 parent 86c30d1 commit 01ceb9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/Development/Testing/Data-Driven-Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To store data for tests, you can use the [Test_Toolkit](https://github.com/BHoM/
2. Right click the component. Use the search field to find and select method you want to store test data for. Once done, the component Unit test will transform into a `UT:MethodName` component.
For example, if you want to test the method called `BaseTypes()`, type and select its name. The component will transform into a `UT:BaseType` component. See screenshot below.
This component will have as many input as the selected method. What it will do is simply run the selected method with any provided input data.
4. Produce some input test data for the method. The test data should cover as many input combinations and "particular inputs" as possible, in order to have good [test coverage](https://en.wikipedia.org/wiki/Fault_coverage#Test_coverage_(computing)).
4. Produce some input test data for the method. This data is simply some objects that the method can take as an input. Don't just do random objects: think about what kind of test data an user may want to input to the test, and about particular "edge" situations you want to make sure that work. The input data should cover as many input combinations and "particular inputs" as it makes sense to, in order to have good [test coverage](https://en.wikipedia.org/wiki/Fault_coverage#Test_coverage_(computing)).
5. Connect the test data to the `Unit Test` component. The component will execute the target method with the provided data, and it will return one or more _Unit Test objects_, which contain the input and outputs related to the method execution.
6. At this point, we will want to store the _Unit Test objects_ as a json somewhere where the automation can find them, so future testing can be done automatically. Our place of choice is the `.ci` folder of the repository where the method being tested can be found.
In order to do this easily and reliably, you can use the Test_Toolkit's `StoreUnitTests` function. Please refer to the screenshot below.
Expand Down

0 comments on commit 01ceb9d

Please sign in to comment.