Skip to content
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

sealed method mock calls actual method instead of mocked #1255

Closed
LogunovAV opened this issue May 5, 2022 · 2 comments
Closed

sealed method mock calls actual method instead of mocked #1255

LogunovAV opened this issue May 5, 2022 · 2 comments

Comments

@LogunovAV
Copy link

if you Mock the method of the class which has sealed identifier, the mock.Object.Method will call an actual method, not the mocked one.

@AlexRuMath
Copy link

if you Mock the method of the class which has sealed identifier, the mock.Object.Method will call an actual method, not the mocked one.
Example:
MockRunTransaction
MockSwaled

@stakx
Copy link
Contributor

stakx commented May 5, 2022

Moq doesn't support sealed classes/methods. You can only mock non-sealed types and virtual, non-sealed methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants