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

Absence of a clause in the documentation about the lack of support for sealed methods #1256

Closed
AlexRuMath opened this issue May 6, 2022 · 2 comments

Comments

@AlexRuMath
Copy link

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

Originally posted by @stakx in #1255 (comment)
Absence of a clause in the documentation about the lack of support for sealed methods

@stakx
Copy link
Contributor

stakx commented May 6, 2022

I suspect this was always thought of as a known, given fact, perhaps because Moq's early user base came from Rhino Mocks, which, I believe, had the same limitations. Most other open-source mocking libraries do, too (at least those based on DynamicProxy).

Feel free to add a mention of this limitation to e.g. the quickstart.

@stakx
Copy link
Contributor

stakx commented May 12, 2022

I've added a brief paragraph to Methods section in the Quickstart (emphasis added):

You can setup the behavior of any of a mock's overridable methods [...]

@stakx stakx closed this as completed May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants