Open sandboxFocus

Method SetReturnValue

SetReturnValue<T>(int, string, string, T)

Sets a given return value and uses the default formatter. A method can have several return values in C# 7.0.

Declaration
public void SetReturnValue<T>(int index, string returnValueName, string typeName, T value)
Parameters
Type Name Description
int index

The index of the return value.

string returnValueName

The name of the return value, or null if there is only one return value in the method.

string typeName

The formatted name of the type T.

T value

The return value.

Type Parameters
Name Description
T

The type of the return value.

SetReturnValue<T>(int, string, string, T, IFormatter<T>)

Sets a given return value and uses a given formatter. A method can have several return values in C# 7.0.

Declaration
public virtual void SetReturnValue<T>(int index, string returnValueName, string typeName, T value, IFormatter<T> formatter)
Parameters
Type Name Description
int index

The index of the return value.

string returnValueName

The name of the return value, or null if there is only one return value in the method.

string typeName

The formatted name of the type T.

T value

The return value.

IFormatter<T> formatter

The formatter to be used to format T.

Type Parameters
Name Description
T

The type of the return value.