You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
Just for completeness' sake, @kzu have you seen .Protected().As<T>() that we added in v4 a while ago? Quick demo in this post.
Defining a parallel interface just for tests of course isn't very nice if you have to manually do it & keep in sync with the protected members, but I imagine you could easily automate that using code fixes (like you have done for typed delegates needed for by-ref parameters).
Oh, that would be neat. The big issue with Moq 4's .Protected().As<TProtectedMembers>() is just that, one needs to write an extra type just for testing. Would be great if that could be automated away.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In v4:
We should offer more compile-time safety in v5 for protected members, possibly with completion providers + analyzers
The text was updated successfully, but these errors were encountered: