![Collapse image Collapse image](collapse_all.gif)
![Expand Image Expand Image](expand_all.gif)
![](collapse_all.gif)
![](expand_all.gif)
![](dropdown.gif)
![](dropdownHover.gif)
![Copy image Copy image](icons/copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Matches a null value of the given TValue type.
Namespace: Moq.Protected
Assembly: Moq (in Moq.dll) Version: 4.0.10827.0 (4.0.0.0)
Syntax
Remarks
Required for protected mocks as the null value cannot be used
directly as it prevents proper method overload selection.
Examples
![](CopyCode.gif)
// Throws an exception for a call to Remove with a null string value. mock.Protected() .Setup("Remove", ItExpr.IsNull<string>()) .Throws(new InvalidOperationException());