I'm using PascalMock (http://sourceforge.net/projects/pascalmock/) to mock various interfaces in my DUnit unit tests.
I am familiar with how to handle parameters and return values, but I don't understand how to code var parameters.
For example, to mock an interfaced version if TIniFile.ReadSections, I have tried:
procedure TIniFileMock.ReadSections(Strings: TStrings);
begin
AddCall('ReadSections').WithParams([Strings]).ReturnsOutParams([Strings]);
end;
and then set the expectation using:
IniMock.Expects('ReadSections').WithParams([Null])
.ReturnsOutParams([Sections]);
but this isn't returning the values that I've put into Sections. I've tried various other permutations, but clearly I'm missing something. There seems to be very little in the way of examples on the internet.
What is the correct way of returning var parameters with PascalMock?