THorse unity tests - Mocks
arthurmluz opened this issue · 1 comments
arthurmluz commented
Hey, how can I make unity tests to validate my middlewares/controller/service?
I'm trying to create a THorseRequestMock and THorseResponseMock that inherit from their respective classes, but as my middlewares expects THorseRequest, it keeps calling the ancestor method when trying to do a Requests.Query, so I get an Access Violation;
How can I do this in a better way?
type
THorseRequestMock = class(THorseRequest)
private
FHeaders : THorseCoreParam;
FQuery : THorseCoreParam;
FParams : THorseCoreParam;
procedure InitializeRequest;
public
constructor Create;
function Headers : THorseCoreParam;
function Query : THorseCoreParam;
function Params : THorseCoreParam;I can't call override because those functions arent virtual;
dps de escrever em ingles eu vi q as issues tão em pt, entao podem responder em PT
viniciussanchez commented
Se for um problema, pode enviar um PR tornando-as como virtual