Moq.Protected Namespace

Moq

Collapse imageExpand ImageCopy imageCopyHover image
Importing this namespace will enable the Protected() method on mocks, enabling expectations on protected members by specifying the member name as a string.

Classes

  ClassDescription
Public classItExpr
Allows the specification of a matching condition for an argument in a protected member setup, rather than a specific argument value. "ItExpr" refers to the argument being matched.
Public classProtectedExtension
Enables the Protected() method on Mock<(Of <(<'T>)>)>, allowing setups to be set for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility.

Interfaces

  InterfaceDescription
Public interfaceIProtectedMock<(Of <(<'TMock>)>)>
Allows setups to be specified for protected members by using their name as a string, rather than strong-typing them which is not possible due to their visibility.