Jump to content
François T

DUnitx and array

Recommended Posts

Posted (edited)

Hello to all,

 

I'm new to DUnitx. We are introducing UnitTesting in our legacy project since 3 month.
I'd like to test a function having a opened array as parameter.

It's not possible directly with TestCase as I read.

I didn't succeed with TestDataProvider.

 

What is the best way to do that ?
 

The function I'd like to test

function IsXXX(const aCurrentXXX: word; const aYYY: word;
  const aXXXArray: array of boolean): boolean;
begin
  result := ((aYYY in AA_GRP) or ((aYYY in BB_GRP) and ((Length(aXXXArray) >= aCurrentXXX) and
    aXXXArray[aCurrentXXX])));
end;

any help will be wellcome,
François

Edited by François T
  • Like 1

Share this post


Link to post

I think you will need to parse a string and do that your own. This should be easy this booleans.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×