I have FileHandler Class which has some data base service call , now when i have mock the database service then ideally where there is db servcie call it should return the mocked database service only . but giving some error
@test:Config{}
function testProcessFile() {
FileHandler filehandler = check new ;
filehandler.dbSrevice = new MockDbService();
}
But givng error at line new MockDbServuce saying incompatible issue as FileHandler class is expecting orginal Dbservice class instead of MockDbService.
How to relsove such cases..
Helpful if i could get the example similar to to that how to handle such scenario