skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class CommonExpectation<TContainer>

Implements common expectations.

Inheritance
System.Object
CommonExpectation<TContainer>
ActionExpectation
CollectionExpectation<TReturn>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.JustMock.Expectations
Assembly: Telerik.JustMock.dll

Syntax

public class CommonExpectation<TContainer> : IAction<TContainer>, IDoInstead<TContainer>, IThrows<TContainer>, IAssertable, IMustBeCalled, ISetupBehavior, IOccurrence, IOrder, IPrerequisite, IDisposable, IInstanceScope<TContainer>, IMethodMock
Type Parameters
TContainer

Properties

IsMet

Determines whether prerequisite is met

Declaration
public bool IsMet { get; }
Property Value
System.Boolean

Implements
IPrerequisite.IsMet

Methods

AfterAll(IPrerequisite[])

Specifies that a call should occur only after all of the given prerequisites have been met.

Declaration
public IAssertable AfterAll(params IPrerequisite[] prerequisites)
Parameters
IPrerequisite[] prerequisites

Returns
IAssertable

Implements
IPrerequisite.AfterAll(IPrerequisite[])

CallOriginal()

Use it to call the real implementation.

Declaration
public IAssertable CallOriginal()
Returns
IAssertable

Implements
IAssertable.CallOriginal()

Dispose()

Removes this arrangement. Its side effects will no longer be executed and its expectations will not be asserted.

Declaration
public void Dispose()
Implements
System.IDisposable.Dispose()

DoInstead(Action)

Defines the body of the expected method that will be executed instead of the orginal method body.

Declaration
public TContainer DoInstead(Action action)
Parameters
System.Action action

delegate the method body

Returns
TContainer

Implements
IDoInstead<TContainer>.DoInstead(Action)

DoInstead(Delegate)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead(Delegate delegate)
Parameters
System.Delegate delegate

Target delegate to evaluate.

Returns
TContainer

Implements
IDoInstead<TContainer>.DoInstead(Delegate)

DoInstead<T1>(Action<T1>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1>(Action<T1> action)
Parameters
System.Action<T1> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1>(Action<T1>)

DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>)

DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>)

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>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer 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> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

T12

Type of the twelveth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.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>)

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>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer 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> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

T12

Type of the twelveth parameter of the method that this delegate encapsulates

T13

Type of the thirteenth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.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>)

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>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer 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> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

T12

Type of the twelveth parameter of the method that this delegate encapsulates

T13

Type of the thirteenth parameter of the method that this delegate encapsulates

T14

Type of the fourteenth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.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>)

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>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer 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> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

T12

Type of the twelveth parameter of the method that this delegate encapsulates

T13

Type of the thirteenth parameter of the method that this delegate encapsulates

T14

Type of the fourteenth parameter of the method that this delegate encapsulates

T15

Type of the fifteenth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.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>)

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>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer 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> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

T10

Type of the tenth parameter of the method that this delegate encapsulates

T11

Type of the eleventh parameter of the method that this delegate encapsulates

T12

Type of the twelveth parameter of the method that this delegate encapsulates

T13

Type of the thirteenth parameter of the method that this delegate encapsulates

T14

Type of the fourteenth parameter of the method that this delegate encapsulates

T15

Type of the fifteenth parameter of the method that this delegate encapsulates

T16

Type of the sixteenth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.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>)

DoInstead<T1, T2>(Action<T1, T2>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2>(Action<T1, T2> action)
Parameters
System.Action<T1, T2> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2>(Action<T1, T2>)

DoInstead<T1, T2, T3>(Action<T1, T2, T3>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3>(Action<T1, T2, T3> action)
Parameters
System.Action<T1, T2, T3> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3>(Action<T1, T2, T3>)

DoInstead<T1, T2, T3, T4>(Action<T1, T2, T3, T4>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4>(Action<T1, T2, T3, T4> action)
Parameters
System.Action<T1, T2, T3, T4> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4>(Action<T1, T2, T3, T4>)

DoInstead<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> action)
Parameters
Action<T1, T2, T3, T4, T5> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5>)

DoInstead<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6> action)
Parameters
Action<T1, T2, T3, T4, T5, T6> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6>)

DoInstead<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7>)

DoInstead<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8>)

DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)

Specifies the delegate that will execute for the expected method.

Declaration
public TContainer DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> action)
Parameters
Action<T1, T2, T3, T4, T5, T6, T7, T8, T9> action

Target action delegate to execute as method body

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the method that this delegate encapsulates

T2

Type of the second parameter of the method that this delegate encapsulates

T3

Type of the third parameter of the method that this delegate encapsulates

T4

Type of the fourth parameter of the method that this delegate encapsulates

T5

Type of the fifth parameter of the method that this delegate encapsulates

T6

Type of the sixth parameter of the method that this delegate encapsulates

T7

Type of the seventh parameter of the method that this delegate encapsulates

T8

Type of the eighth parameter of the method that this delegate encapsulates

T9

Type of the ninth parameter of the method that this delegate encapsulates

Implements
IDoInstead<TContainer>.DoInstead<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Action<T1, T2, T3, T4, T5, T6, T7, T8, T9>)

DoNothing()

Specfies call a to step over.

Declaration
public IAssertable DoNothing()
Returns
IAssertable

Refarence to IAssertable

Implements
IAction<TContainer>.DoNothing()
Remarks

For loose mocks by default the behavior is step over.

IgnoreArguments()

Specifies to ignore any argument for the target call.

Declaration
public TContainer IgnoreArguments()
Returns
TContainer

Func or Action Container

IgnoreInstance()

Defines that the expectation should occur for all instance.

Declaration
public TContainer IgnoreInstance()
Returns
TContainer

Implements
IInstanceScope<TContainer>.IgnoreInstance()

InOrder(String)

Specifies a call should occur in a specific order.

Declaration
public IOccurrence InOrder(string message = null)
Parameters
System.String message

Returns
IOccurrence

Implements
IOrder.InOrder(String)

InSequence()

Specifies that JustMock should invoke different mock instance for each setup.

Declaration
public IAssertable InSequence()
Returns
IAssertable

Implements
ISetupBehavior.InSequence()
Remarks

When this modifier is applied for similar type call, the flow of setups will be maintained.

MustBeCalled(String)

Specifies that the arranged member must be called. Asserting the mock will throw if the expectation is not fulfilled.

Declaration
public IDisposable MustBeCalled(string message = null)
Parameters
System.String message

Returns
System.IDisposable

Implements
IMustBeCalled.MustBeCalled(String)

Occurs(Int32, String)

Specifies how many times the call should occur.

Declaration
public IDisposable Occurs(int numberOfTimes, string message = null)
Parameters
System.Int32 numberOfTimes

Specified number of times

System.String message

Returns
System.IDisposable

Implements
IOccurrence.Occurs(Int32, String)

OccursAtLeast(Int32, String)

Specifies how many times atleast the call should occur.

Declaration
public IDisposable OccursAtLeast(int numberOfTimes, string message = null)
Parameters
System.Int32 numberOfTimes

Specified number of times

System.String message

Returns
System.IDisposable

Implements
IOccurrence.OccursAtLeast(Int32, String)

OccursAtMost(Int32, String)

Specifies how many times maximum the call can occur.

Declaration
public IDisposable OccursAtMost(int numberOfTimes, string message = null)
Parameters
System.Int32 numberOfTimes

Specified number of times

System.String message

Returns
System.IDisposable

Implements
IOccurrence.OccursAtMost(Int32, String)

OccursNever(String)

Specifies that the call must never occur.

Declaration
public IDisposable OccursNever(string message = null)
Parameters
System.String message

Returns
System.IDisposable

Implements
IOccurrence.OccursNever(String)

OccursOnce(String)

Specifies that the call must occur once.

Declaration
public IDisposable OccursOnce(string message = null)
Parameters
System.String message

Returns
System.IDisposable

Implements
IOccurrence.OccursOnce(String)

OnAllThreads()

Specifies that the arrangement will be respected regardless of the thread on which the call to the arranged member happens.

Declaration
public IAssertable OnAllThreads()
Returns
IAssertable

Implements
ISetupBehavior.OnAllThreads()
Remarks

This is only needed for arrangements of static members. Arrangements on instance members are always respected, regardless of the current thread.

Cross-thread arrangements are active as long as the current context (test method) is on the call stack. Be careful when arranging static members cross-thread because the effects of the arrangement may affect and even crash the testing framework.

ProcessDoInstead(Delegate, Boolean)

Implementation detail.

Declaration
protected void ProcessDoInstead(Delegate delg, bool ignoreDelegateReturnValue)
Parameters
System.Delegate delg

System.Boolean ignoreDelegateReturnValue

Raises(Action, EventArgs)

Raises the expected event with provided System.EventArgs.

Declaration
public TContainer Raises(Action eventExpression, EventArgs args)
Parameters
System.Action eventExpression

System.EventArgs args

Event arguments

Returns
TContainer

Implements
IAction<TContainer>.Raises(Action, EventArgs)
Exceptions
System.InvalidOperationException

Raises(Action, Object[])

Raises the expected with sepecic arguments

Declaration
public TContainer Raises(Action eventExpression, params object[] args)
Parameters
System.Action eventExpression

System.Object[] args

Returns
TContainer

Implements
IAction<TContainer>.Raises(Action, Object[])

Raises<T1>(Action, Func<T1, EventArgs>)

Raises the expected event for the setup.

Declaration
public TContainer Raises<T1>(Action eventExpression, Func<T1, EventArgs> func)
Parameters
System.Action eventExpression

System.Func<T1, System.EventArgs> func

Function that will be used to construct event arguments

Returns
TContainer

Type Parameters
T1

Implements
IAction<TContainer>.Raises<T1>(Action, Func<T1, EventArgs>)
Exceptions
System.InvalidOperationException

Raises<T1, T2>(Action, Func<T1, T2, EventArgs>)

Raises the expected event for the setup.

Declaration
public TContainer Raises<T1, T2>(Action eventExpression, Func<T1, T2, EventArgs> func)
Parameters
System.Action eventExpression

System.Func<T1, T2, System.EventArgs> func

An function that will be used to construct event arguments

Returns
TContainer

Type Parameters
T1

T2

Implements
IAction<TContainer>.Raises<T1, T2>(Action, Func<T1, T2, EventArgs>)
Exceptions
System.InvalidOperationException

Raises<T1, T2, T3>(Action, Func<T1, T2, T3, EventArgs>)

Raises the expected event for the setup.

Declaration
public TContainer Raises<T1, T2, T3>(Action eventExpression, Func<T1, T2, T3, EventArgs> func)
Parameters
System.Action eventExpression

System.Func<T1, T2, T3, System.EventArgs> func

An function that will be used to construct event arguments

Returns
TContainer

Type Parameters
T1

T2

T3

Implements
IAction<TContainer>.Raises<T1, T2, T3>(Action, Func<T1, T2, T3, EventArgs>)
Exceptions
System.InvalidOperationException

Raises<T1, T2, T3, T4>(Action, Func<T1, T2, T3, T4, EventArgs>)

Raises the expected event for the setup.

Declaration
public TContainer Raises<T1, T2, T3, T4>(Action eventExpression, Func<T1, T2, T3, T4, EventArgs> func)
Parameters
System.Action eventExpression

System.Func<T1, T2, T3, T4, System.EventArgs> func

An function that will be used to construct event arguments

Returns
TContainer

Type Parameters
T1

T2

T3

T4

Implements
IAction<TContainer>.Raises<T1, T2, T3, T4>(Action, Func<T1, T2, T3, T4, EventArgs>)
Exceptions
System.InvalidOperationException

Throws(Exception)

Throws a the specified expection for target call.

Declaration
public IAssertable Throws(Exception exception)
Parameters
System.Exception exception

Returns
IAssertable

Implements
IThrows<TContainer>.Throws(Exception)

Throws<T>()

Throws a the specified expection for target call.

Declaration
public IAssertable Throws<T>()
    where T : Exception
Returns
IAssertable

Type Parameters
T

Implements
IThrows<TContainer>.Throws<TException>()

Throws<T>(Object[])

Throws a the specified expection for target call.

Declaration
public IAssertable Throws<T>(params object[] args)
    where T : Exception
Parameters
System.Object[] args

Returns
IAssertable

Type Parameters
T

Implements
IThrows<TContainer>.Throws<TException>(Object[])

ThrowsAsync(Exception)

Throws a the specified exception for the target async call causing returned task to fail.

Declaration
public IAssertable ThrowsAsync(Exception exception)
Parameters
System.Exception exception

Returns
IAssertable

Implements
IThrows<TContainer>.ThrowsAsync(Exception)

ThrowsAsync<T>()

Throws a the specified exception for the target async call causing returned task to fail.

Declaration
public IAssertable ThrowsAsync<T>()
    where T : Exception
Returns
IAssertable

Type Parameters
T

Implements
IThrows<TContainer>.ThrowsAsync<TException>()

ThrowsAsync<T>(Object[])

Throws a the specified exception for the target async call causing returned task to fail.

Declaration
public IAssertable ThrowsAsync<T>(params object[] args)
    where T : Exception
Parameters
System.Object[] args

Returns
IAssertable

Type Parameters
T

Implements
IThrows<TContainer>.ThrowsAsync<TException>(Object[])

When(Func<Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When(Func<bool> condition)
Parameters
System.Func<System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

When<T1>(Func<T1, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1>(Func<T1, bool> condition)
Parameters
System.Func<T1, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

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, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

T12

Type of the twelveth parameter of the anonymous method that this delegate encapsulates

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, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

T12

Type of the twelveth parameter of the anonymous method that this delegate encapsulates

T13

Type of the thirteenth parameter of the anonymous method that this delegate encapsulates

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, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

T12

Type of the twelveth parameter of the anonymous method that this delegate encapsulates

T13

Type of the thirteenth parameter of the anonymous method that this delegate encapsulates

T14

Type of the fourteenth parameter of the anonymous method that this delegate encapsulates

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, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

T12

Type of the twelveth parameter of the anonymous method that this delegate encapsulates

T13

Type of the thirteenth parameter of the anonymous method that this delegate encapsulates

T14

Type of the fourteenth parameter of the anonymous method that this delegate encapsulates

T15

Type of the fifteenth parameter of the anonymous method that this delegate encapsulates

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, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer 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> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

T10

Type of the tenth parameter of the anonymous method that this delegate encapsulates

T11

Type of the eleventh parameter of the anonymous method that this delegate encapsulates

T12

Type of the twelveth parameter of the anonymous method that this delegate encapsulates

T13

Type of the thirteenth parameter of the anonymous method that this delegate encapsulates

T14

Type of the fourteenth parameter of the anonymous method that this delegate encapsulates

T15

Type of the fifteenth parameter of the anonymous method that this delegate encapsulates

T16

Type of the sixteenth parameter of the anonymous method that this delegate encapsulates

When<T1, T2>(Func<T1, T2, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2>(Func<T1, T2, bool> condition)
Parameters
System.Func<T1, T2, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3>(Func<T1, T2, T3, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3>(Func<T1, T2, T3, bool> condition)
Parameters
System.Func<T1, T2, T3, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4>(Func<T1, T2, T3, T4, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4>(Func<T1, T2, T3, T4, bool> condition)
Parameters
System.Func<T1, T2, T3, T4, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5, T6, T7, T8>(Func<T1, T2, T3, T4, T5, T6, T7, T8, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

When<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, Boolean>)

Specifies an additional condition that must be true for this arrangement to be considered when the arranged member is called. This condition is evaluated in addition to the conditions imposed by any argument matchers in the arrangement.

This method allows a more general way of matching arrangements than argument matchers do.

Declaration
public TContainer When<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool> condition)
Parameters
Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, System.Boolean> condition

A function that should return 'true' when this arrangement should be considered and 'false' if this arrangement doesn't match the user criteria.

Returns
TContainer

Type Parameters
T1

Type of the first parameter of the anonymous method that this delegate encapsulates

T2

Type of the second parameter of the anonymous method that this delegate encapsulates

T3

Type of the third parameter of the anonymous method that this delegate encapsulates

T4

Type of the fourth parameter of the anonymous method that this delegate encapsulates

T5

Type of the fifth parameter of the anonymous method that this delegate encapsulates

T6

Type of the sixth parameter of the anonymous method that this delegate encapsulates

T7

Type of the seventh parameter of the anonymous method that this delegate encapsulates

T8

Type of the eighth parameter of the anonymous method that this delegate encapsulates

T9

Type of the ninth parameter of the anonymous method that this delegate encapsulates

Extension Methods

FluentHelper.Arrange<T, TResult>(T, Expression<Func<T, TResult>>)
FluentHelper.Arrange<T>(T, Expression<Action<T>>)
FluentHelper.ArrangeSet<T>(T, Action<T>)
FluentHelper.ArrangeLike<T>(T, Expression<Func<T, Boolean>>)
FluentHelper.Assert<T, TReturn>(T, Expression<Func<T, TReturn>>, String)
FluentHelper.Assert<T, TReturn>(T, Expression<Func<T, TReturn>>, Occurs, String)
FluentHelper.Assert<T>(T, Expression<Action<T>>, String)
FluentHelper.Assert<T>(T, Expression<Action<T>>, Occurs, String)
FluentHelper.AssertSet<T>(T, Action<T>, String)
FluentHelper.AssertSet<T>(T, Action<T>, Occurs, String)
FluentHelper.Raise<T>(T, Action<T>, EventArgs)
FluentHelper.Raise<T>(T, Action<T>, Object[])
FluentHelper.Assert<T>(T, String)
FluentHelper.AssertAll<T>(T, String)
MultipleReturnValueChainHelper.Returns<TReturn>(IAssertable, TReturn)
Getting Started
  • Unit Testing and Mocking Explained
  • Videos
  • FAQs
Community
  • Forums
  • Blogs
  • Feedback Portal

Copyright © 2019 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.