|
VECTO Input Manager
|
This NUnit test project validates the VECTO Input Manager functionality and also includes utilities for code generation.
VectoInputManager.Tests.Core - Core functionality tests
VectoInputManager.Tests.Console - Console command tests
VectoInputManager.Tests.StandardValues - Standard value calculation tests
VectoInputManager.Tests.Samples - Sample processing tests
The utilities below are included in the test project but are marked as [Explicit] tests. They are not run automatically and must be executed manually when needed.
VectoInputManager.Tests.CodeGeneration - Code generation utilities (see next section for details)
VectoInputManager.Tests.Utilities - Data Generation Utilities
The test class StandardValues_Tests validates the standard values calculation methodology for vehicle components. The test calculates component standard values from JSON input files and compares the results against expected XML output files.
Test cases are created by adding pairs of files: each JSON input file must have a matching XML expected output file with the same base name.
Test cases are organized in component-specific folders under:
For each component type, the test:
Each test case consists of a pair of files with matching base names:
The test automatically discovers all JSON files and looks for their corresponding XML pairs.
To add a new test case, create a pair of files:
Running the test again will automatically discover and validate the new pair.
Test output is generated in: VectoInputManagerTests/Output/{DateTime}/InputOutput_Tests/
VECTO XSDs are located in the path VectoCore/VectoCore/Resources/XSD and are used to generate C# classes representing VECTO objects. If the XSD files are modified, do the following to update the projects:
1) Execute GenerateVectoObjects_Utility/GenerateVectoObjects
This will generate the file VectoInputManagerTests/Output/{DateTime}/VectoObjects.cs. Copy this and replace the file VectoObjects/Generated/VectoObjects.cs
2) Update the JSON schemas by running CodeGeneration_Utility/GenerateComponentInputJsonSchemas
This updates the JSON Schema files in the folders:
Important: These files should be committed to a public repository, and its base URL should be reflected in the file VectoInputManager\VectoInputManagerCore\Consts.cs
3) Execute all tests in the VectoInputManagerTests project.
If the XSDs include new vehicles, then also do the following after step (1) above and before step (2).
1) Execute CodeGeneration_Utility/GenerateVehicleTypesData_Utility
This will generate the file VectoInputManagerTests/Output/{DateTime}/VehicleTypes.csv. Edit it and then replace the file VectoInputManagerCore/Data/VehicleTypes.csv.
2) Execute CodeGeneration_Utility/Generate_VehicleTypesCs_Utility
This will generate the file VectoInputManagerTests/Output/{DateTime}/VehicleTypes.cs. Replace the file VectoObjects/VehicleTypes.cs
The VectoInputManager.Tests.Samples namespace includes tests that check serialization, deserialization, hash, output xml validation on all the official VECTO Job samples (last updated 23-05-2025).
Samples can be added to the folder VectoInputManager\VectoInputManagerTests\Input\Samples.