Problem in writing application test #14258
Unanswered
mazarkaman
asked this question in
Q&A
Replies: 3 comments 2 replies
You can set the
|
1 reply
|
The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
Imagine I have two application services:
WebInfoAppServiceandMainAppServiceMainAppService is:
now I want to write a test for this class:
I should use Substitute.For in order to set return value for
IsConnectedAsyncmethod ofIWebInfoAppServiceclass so i have to declareMainAppServiceWithout usingGetRequiredService<IMainAppService>()the problem is**CurrentUser**always null and if i useGetRequiredService<IMainAppService>(), CurrentUser will filled with data. what should I do to either change class behavior after it's injected or get data in CurrentUser if I declare WebInfoAppService directly?All reactions