-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested asynchronous functions are not executed #300
Comments
The problem here is that Moq also mocks the You can get Moq to call your logic in var client = new Mock<ServiceClient>(…) { CallBase = true };
// ^^^^^^^^^^^^^^^^^^^ |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
While mocking an object that have a synchronous method which internally executes an asynchronous method is not returning correct results. Eventhough, the setup was configured correctly, it didn't execute the nested asynchronous methods that returns a Task. Following is my object to mock.
And following is my unit test.
This test fails and verify confirms that DoSomethingMore() method was never executed.
Complete source code is also attached to easily reproduce the issue.
MoqTesting.zip
The text was updated successfully, but these errors were encountered: