SetupAllProperties Method

Moq

Collapse imageExpand ImageCopy imageCopyHover image
Specifies that the all properties on the mock should have "property behavior", meaning that setting its value will cause it to be saved and later returned when the property is requested. (this is also known as "stubbing"). The default value for each property will be the one generated as specified by the DefaultValue property for the mock.

Namespace: Moq
Assembly: Moq (in Moq.dll) Version: 4.0.10827.0 (4.0.0.0)

Syntax

C#
public Mock<T> SetupAllProperties()

Remarks

If the mock DefaultValue is set to Mock, the mocked default values will also get all properties setup recursively.

See Also