NSubstitute
NSubstitute copied to clipboard
Docs: fix overridable member documentation
From https://github.com/nsubstitute/NSubstitute/issues/222#issuecomment-557198534, saying protected virtual is substitutable is misleading. While technically possible (hacky) with the current API, it's not something we encourage and people should not expect to mock these members with NSubstitute.
By overridable we mean public virtual, protected virtual, protected internal virtual, or internal virtual with InternalsVisibleTo attribute applied.
Implementing this and realised it is actually a bit more nuanced. The documentation is referring to real code executing for non-overridable members. This includes code in protected virtual, even if these calls are not (easily) configurable via the NSubstitute API.
Will update the docs to try to reflect this a bit better.