November 2019
Beginner to intermediate
674 pages
15h
English
I mentioned before that proxy objects can be used for unit testing. In unit testing, we frequently encounter a situation when the tested unit uses some interface from another (and therefore not tested) unit and that second interface pulls in whole lots of code, accesses database, runs a lengthy calculation, or in other ways disturbs the testing process. In such cases, we can replace that interface with a mock object that functions as a virtual proxy.
Creating mock objects is a broad topic, and multiple Delphi libraries exist to help with that job. In this example, I will use the Spring4D library (https://bitbucket.org/sglienke/spring4d) and its Mock<T> record.
A short demonstration of Spring4D mocking, which ...
Read now
Unlock full access