Mock object library for Delphi/Kylix/Free Pascal. This library enables the easy creation and use of Mock objects for unit testing.
Questions tagged [pascalmock]
4 questions
9
votes
3 answers
How do I prevent my unit tests from requiring knowledge about implementation internals when using mock objects?
I'm still in the learning stages regarding unit-testing and in particular regarding mocking (I'm using the PascalMock and DUnit frameworks). One thing I now stumbled over was that I couldn't find a way around hard-coding implementation details of…

Oliver Giesen
- 9,129
- 6
- 46
- 82
2
votes
2 answers
How do I mock a method with an open array parameter in PascalMock?
I'm currently in the process of getting started with unit testing and mocking for good and I stumbled over the following method that I can't seem to fabricate a working mock implementation for:
function GetInstance(const AIID: TGUID;
…

Oliver Giesen
- 9,129
- 6
- 46
- 82
1
vote
1 answer
How to return var parameters with PascalMock
I'm using PascalMock (http://sourceforge.net/projects/pascalmock/) to mock various interfaces in my DUnit unit tests.
I am familiar with how to handle parameters and return values, but I don't understand how to code var parameters.
For example, to…

Richard A
- 2,783
- 2
- 22
- 34
0
votes
0 answers
How to pass/return records with PascalMock requiring Variants?
PascalMock with Delphi 2010 works fine when using simple data types or objects. With records, however, there's trouble.
TMock.Returns takes an array of TVarRec, so I can't just pass a one in.
There is a sample which casts it to a pointer, but since…

Thijs van Dien
- 6,516
- 1
- 29
- 48