I have a .NET 6 app and I am creating integration tests for this system. I use FakeItEasy and I have a problem with mocking a service which is not used directly in my test. The process looks like this:
- Prepare data for the test
- Send first command - I don't mock anything here
- The first command is handled by a specific handler in the system
- Do a few things there; most importantly - one of the filters sends a second (different than the first one) command
- The second command is handled by a specific handler - this is where the service is which I want to mock
I don't have any idea for this example. I cannot pass a mocking version of the service in the body of the test because I don't use it directly in the test.
Could you give me some idea how can I do this?