My question is similar to this one, but instead of a set, I'd like to pass an array of integers.
Per example:
[TestCase('TestAdd','[1,2,3,4];[1,2,3,4]',';')]
procedure TestAdd(aValue, aResult: array of integer);
Modifying the DUnitX.Utils seems like the cleanest approach, but I'm not sure how to go about doing the conversion. My main question is, how will it know that I need specifically an array of integers? Is there something in the PTypeInfo that I can take advantage of?
You cannot use an open array because the RTTI is missing code to invoke methods with such arguments (which are implemented by actually two arguments under the hood). So you need to change the signature to use
TArray<T>
or any other dynamic array type.Then the modification to DUnitX.Utils is really easy - just add this function to the Conversions array for tkUString->tkDynArray (any possible optimization is left as an exercise for the reader):