New to Telerik JustMockStart a free 30-day trial

Defines the expectation for a specific method.

Definition

Namespace:Telerik.JustMock.Expectations

Assembly:Telerik.JustMock.dll

Type Parameters:

TReturn

Syntax:

C#
public class FuncExpectation<TReturn> : CollectionExpectation<TReturn>, IAction<FuncExpectation<TReturn>>, IDoInstead<FuncExpectation<TReturn>>, IThrows<FuncExpectation<TReturn>>, IInstanceScope<FuncExpectation<TReturn>>, IReturnCollection, IFunc<TReturn>, IThrows<IFunc<TReturn>>, IReturns<TReturn>, IAssertable, IMustBeCalled, ISetupBehavior, IOccurrence, IOrder, IPrerequisite, IDisposable, IIgnorable<FuncExpectation<TReturn>>, IWhen<FuncExpectation<TReturn>>

Inheritance: objectCommonExpectation<FuncExpectation<TReturn>>CollectionExpectation<TReturn>FuncExpectation<TReturn>

Implements: IAction<FuncExpectation<TReturn>>IAssertableIDisposableIDoInstead<FuncExpectation<TReturn>>IFunc<TReturn>IIgnorable<FuncExpectation<TReturn>>IInstanceScope<FuncExpectation<TReturn>>IMustBeCalledIOccurrenceIOrderIPrerequisiteIReturnCollectionIReturns<TReturn>ISetupBehaviorIThrows<FuncExpectation<TReturn>>IThrows<IFunc<TReturn>>IWhen<FuncExpectation<TReturn>>...

Inherited Members CollectionExpectation<TReturn>.ReturnsCollection<TArg>(IEnumerable<TArg>)CollectionExpectation<TReturn>.ProcessReturnsValue(TReturn)CommonExpectation<FuncExpectation<TReturn>>.ProcessDoInstead(Delegate, bool)CommonExpectation<FuncExpectation<TReturn>>.DoInstead(Action)CommonExpectation<FuncExpectation<TReturn>>.DoInstead(Delegate)CommonExpectation<FuncExpectation<TReturn>>.Raises(Action, params object[])CommonExpectation<FuncExpectation<TReturn>>.Raises(Action, EventArgs)CommonExpectation<FuncExpectation<TReturn>>.Raises<T1>(Action, Func<T1, EventArgs>)CommonExpectation<FuncExpectation<TReturn>>.Raises<T1, T2>(Action, Func<T1, T2, EventArgs>)CommonExpectation<FuncExpectation<TReturn>>.Raises<T1, T2, T3>(Action, Func<T1, T2, T3, EventArgs>)CommonExpectation<FuncExpectation<TReturn>>.Raises<T1, T2, T3, T4>(Action, Func<T1, T2, T3, T4, EventArgs>)CommonExpectation<FuncExpectation<TReturn>>.Throws(Exception)CommonExpectation<FuncExpectation<TReturn>>.Throws<T>()CommonExpectation<FuncExpectation<TReturn>>.Throws<T>(params object[])CommonExpectation<FuncExpectation<TReturn>>.ThrowsAsync(Exception)CommonExpectation<FuncExpectation<TReturn>>.ThrowsAsync<T>()CommonExpectation<FuncExpectation<TReturn>>.ThrowsAsync<T>(params object[])CommonExpectation<FuncExpectation<TReturn>>.CallOriginal()CommonExpectation<FuncExpectation<TReturn>>.DoNothing()CommonExpectation<FuncExpectation<TReturn>>.MustBeCalled(string)CommonExpectation<FuncExpectation<TReturn>>.Occurs(int, string)CommonExpectation<FuncExpectation<TReturn>>.OccursAtLeast(int, string)CommonExpectation<FuncExpectation<TReturn>>.OccursAtMost(int, string)CommonExpectation<FuncExpectation<TReturn>>.OccursOnce(string)CommonExpectation<FuncExpectation<TReturn>>.OccursNever(string)CommonExpectation<FuncExpectation<TReturn>>.InSequence()CommonExpectation<FuncExpectation<TReturn>>.InOrder(string)CommonExpectation<FuncExpectation<TReturn>>.AfterAll(params IPrerequisite[])CommonExpectation<FuncExpectation<TReturn>>.IgnoreInstance()CommonExpectation<FuncExpectation<TReturn>>.OnAllThreads()CommonExpectation<FuncExpectation<TReturn>>.When(Func<bool>)CommonExpectation<FuncExpectation<TReturn>>.IgnoreArguments()CommonExpectation<FuncExpectation<TReturn>>.Dispose()CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1>(Action<T1>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2>(Action<T1, T2>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3>(Action<T1, T2, T3>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4>(Action<T1, T2, T3, T4>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>)CommonExpectation<FuncExpectation<TReturn>>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>)CommonExpectation<FuncExpectation<TReturn>>.When<T1>(Func<T1, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2>(Func<T1, T2, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3>(Func<T1, T2, T3, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4>(Func<T1, T2, T3, T4, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, bool>)CommonExpectation<FuncExpectation<TReturn>>.When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, bool>)CommonExpectation<FuncExpectation<TReturn>>.IsMet...

Methods

Specifies the return value for the arranged call by using the supplied delegate.

C#
public IAssertable Returns(Delegate @delegate)
Parameters:delegateDelegate

Delegate to run when the arranged call occurs.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Implements: IFunc<TReturn>.Returns(Delegate)

Specifies the return value by using the previously arranged return value as input.

C#
public IAssertable Returns(Func<TReturn, TReturn> func)
Parameters:funcFunc<TReturn, TReturn>

Function that transforms the arranged return value.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Specifies the return value for the arranged call by using the supplied function.

C#
public IAssertable Returns(Func<TReturn> func)
Parameters:funcFunc<TReturn>

Function to run when the arranged call occurs.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Implements: IFunc<TReturn>.Returns(Func<TReturn>)

Defines the return value for a specific method expectation.

C#
public IAssertable Returns(TReturn value)
Parameters:valueTReturn

Value to return.

Returns:

IAssertable

The current expectation so that you can continue the arrangement.

Implements: IFunc<TReturn>.Returns(TReturn)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, T7, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, T6, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, T5, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3, T4>(Func<T1, T2, T3, T4, TReturn> func)
Parameters:funcFunc<T1, T2, T3, T4, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3, T4>(Func<T1, T2, T3, T4, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2, T3>(Func<T1, T2, T3, TReturn> func)
Parameters:funcFunc<T1, T2, T3, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2, T3>(Func<T1, T2, T3, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1, T2>(Func<T1, T2, TReturn> func)
Parameters:funcFunc<T1, T2, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1, T2>(Func<T1, T2, TReturn>)

Specifies the delegate that will execute and return the value for the expected member.

C#
public IAssertable Returns<T1>(Func<T1, TReturn> func)
Parameters:funcFunc<T1, TReturn>Returns:

IAssertable

Reference to IAssertable interface.

Implements: IReturns<TReturn>.Returns<T1>(Func<T1, TReturn>)

In this article
DefinitionMethodsReturns(Delegate)Returns(Func<TReturn, TReturn>)Returns(Func<TReturn>)Returns(TReturn)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, TReturn>)Returns<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, TReturn>)Returns<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, TReturn>)Returns<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, TReturn>)Returns<T1, T2, T3, T4>(Func<T1, T2, T3, T4, TReturn>)Returns<T1, T2, T3>(Func<T1, T2, T3, TReturn>)Returns<T1, T2>(Func<T1, T2, TReturn>)Returns<T1>(Func<T1, TReturn>)
Not finding the help you need?
Contact Support