问题
I would like to, using Delphi-Mocks, mock a class with a function returning a record. TValue and my record are reported as incompatible types. Is there any way I can do this with WillExecute or any other way?
回答1:
Found out:
myMock.Setup.WillReturnDefault('function_name', TValue.From(rec_variable));
来源:https://stackoverflow.com/questions/34987688/returning-records-in-delphi-mocks