BH.oM.Test.UnitTests.UnitTest¶
Defines a data-driven unit test for a specific method. Class defines inputs, method to be run and expected output.
Class structure¶
Implemented interfaces and base types¶
The UnitTest is inheriting from the following base type(s) and implements the following interfaces:
- BH.oM.Base.BHoMObject
- BH.oM.Base.IBHoMObject
- BH.oM.Base.IObject
Properties¶
Defining properties¶
The following properties are defined on the class
Name | Type | Description | Quantity |
---|---|---|---|
Method | MethodBase | The method to be tested. For BHoM methods this can be extracted from the BHoMMethodList method in the Reflection_Engine. | - |
Data | List<TestData> | List of input/output pairs to test the method for. Each TestData item corresponds to one run of the method. | - |
Inherited properties¶
The following properties are inherited from the base class of the object
Name | Type | Description | Quantity |
---|---|---|---|
BHoM_Guid | Guid | - | - |
Name | string | - | - |
Fragments | FragmentSet | - | - |
Tags | HashSet<string> | - | - |
CustomData | Dictionary<string, object> | - | - |
Code and Schema¶
C# implementation¶
Assembly: Test_oM.dll
The C# class definition is available on github:
All history and changes of the class can be found by inspection the history.
JSON Schema implementation¶
The object is defined as a JSON schema. You can validate a JSON instance against this schema by reference. To do this, use the schema reference below in a validator like this one.
JSON Schema
{
"$ref" : "https://raw.githubusercontent.com/BHoM/BHoM_JSONSchema/develop/Test_oM/UnitTests/UnitTest.json"
}
The JSON Schema is available on github here: