Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!

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   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

About author

Software Developer | CS(CyberSec) Undergrad at APU Malaysia | Delphi/C++ Builder Enthusiast | Microsoft Learn Student Ambassador | Microsoft Azure Certified

Leave a Reply

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