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
- 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!