RAD Studio 10.4.1 is now available! Learn more. Looking for discounts? Visit our Special Offers page!
CodeDelphi

Quickly Learn Mocking In Delphi With Spring4D

In this CodeRage session, Bernd Ua shows you the power and benefits of unit testing and mocking with Spring4D open-source framework.

Overview of the Spring4D

  • Spring4D is a great open-source framework to leverage the power of Delphi. In this session, you will learn about the mocking framework contained in Spring4D. We will see how easy it is to get started with mocking and mock out interfaces your classes under tests are using.

What is mocking?

  • If you are mocking out something you replace a productive implementation with a special implementation for testing, the so-called mock
  • You can write Mocks manually or use ones that have been automatically created by frameworks
  • The difference between mocks and stubs or dummies is some extra code to log and heck calls made to the mock

What a Unit test should not do

  • A Unit test should better not use
    • Databases
    • Network access
    • File Systems
    • External Resouces
    • A Configured Environment

So, if your unit test uses one of the above it is more likely an integration test.

Be sure to watch the CodeRage session to learn more about mocking and mocking practices in action!


Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.
Start Free Trial   Learn More About Upgrading

Deep Dive Webinar: Boost C++Builder Compile Speed with TwineCompile
About author

Software Developer | B.Tech-CSE at AUT | Delphi/C++ Builder Enthusiast | Microsoft Learn Student Ambassador | Microsoft Azure Certified | Udacity Alumni
Related posts
CodeDelphi

Quickly Build Enterprise-Grade Multi-Tier Solutions Using DataSnap In Delphi And C++

C++CodeDelphi

Easily Create A Python Container Type In Delphi And Execute It In This Windows Sample App

C++DelphiRAD Studio

Manual uninstall of RAD Studio/Delphi/C++Builder 10.4 Sydney

CodeDelphiRAD Studio

Learn How To Send Arrays To A PostgreSQL Database Server Using FireDAC In Delphi On Windows

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES