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

Does ReturnsAsnyc not available for protected setup? #1264

Closed
hh23485 opened this issue May 25, 2022 · 2 comments
Closed

Does ReturnsAsnyc not available for protected setup? #1264

hh23485 opened this issue May 25, 2022 · 2 comments

Comments

@hh23485
Copy link

hh23485 commented May 25, 2022

Does ReturnsAsnyc not available for protected setup?
It works in non-protected functions, but can't in protected? is by design?

@Prodigio
Copy link

Prodigio commented Jun 3, 2022

Is a protected method not only available for the class, which inherits from that other class with it's protected method? So it's by design not a choice of Moq?

@stakx
Copy link
Contributor

stakx commented Jun 3, 2022

@Prodigio, it's perfectly possible for Moq to set up protected members, as long as they are overridable.

@hh23485, AFAIK, this isn't "by design" because this part of Moq's API was added by contributors, and this particular method simply wasn't included in past contributions. Generally speaking, some APIs that got added later on (such as those behind .Protected() or .SetupSequence(...)) simply aren't as feature-complete as the main API for public members mainly for historical reasons.

@hh23485 hh23485 closed this as completed Sep 19, 2022
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