OneOf(T) Method

Moq

Collapse imageExpand ImageCopy imageCopyHover image
Creates an mock object of the indicated type.

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

Syntax

C#
[ObsoleteAttribute("Moved to Mock.Of<T>, as it's a single one, so no reason to be on Mocks.", 
	true)]
public static T OneOf<T>()
where T : class

Type Parameters

T
The type of the mocked object.

Return Value

The mocked object created.

See Also