Returning records in Delphi-Mocks

眉间皱痕 提交于 2021-01-28 17:35:32

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!