How to use DependencyInjection in TestKit #6090
-
I have an actor that initializes a child actor like so:
The DependencyResolver resolves dependencies for the AccountDbWriter child actor (specifically, The above works fine when I run the system. But I'm trying to write tests for this Please advise on how this can be done? More context:
More context, the DbWriterActor that the AccountActor (sut) creates as its child, is defined as follows:
What I can't figure out is how to get TestKit's .Sys to use the above mocked Please help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok I figured it out!! You need a method that will set up a mock
Then in the constructor of the TestFixture, you pass this mocked
|
Beta Was this translation helpful? Give feedback.
Ok I figured it out!!
You need a method that will set up a mock
IServiceProvider
. Here's mine usingMoq
: