Hello,
I'm using spring4d for unit testing, and I've run into a challenge: I need to mock a method that doesn't belong to a class, such as CreateProcess, GetTempPath... from Winapi.Windows. Is there any way to mock these system-level functions using Spring4d, without changing the original code?
An example of using them:
1. function GetWinTmpPath:string;
...
GetTempPath(Requiered, Pchar(Result));
...
2. function WinExec(const cmd:string; const cmdshow: integer):cardinal;
begin
...
Result:=CreateProcess(..);
if result then ...
...
end;
Thanks in advance!