Interface
IThrows<TContainer>

Provides methods for arranging exceptions to be thrown when a mocked member is called.

Definition

Namespace:Telerik.JustMock.Expectations.Abstraction

Assembly:Telerik.JustMock.dll

Type Parameters:

TContainer

Expectation type that continues the arrangement.

Syntax:

cs-api-definition
public interface IThrows<TContainer>

Derived Classes: ActionExpectationCollectionExpectation<TReturn>CommonExpectation<TContainer>FuncExpectation<TReturn>FuncExpectation<TReturn>

Methods

Throws(Exception)

Throws the specified exception when the arranged call occurs.

Declaration

cs-api-definition
IAssertable Throws(Exception exception)

Parameters

exception

Exception

Exception instance to throw.

Returns

IAssertable

The current expectation so that you can continue the arrangement.

Throws<TException>()

Throws a new exception of the specified type when the arranged call occurs.

Declaration

cs-api-definition
IAssertable Throws<TException>() where TException : Exception

Returns

IAssertable

The current expectation so that you can continue the arrangement.

Throws<TException>(params object[])

Throws a new exception of the specified type when the arranged call occurs.

Declaration

cs-api-definition
IAssertable Throws<TException>(params object[] args) where TException : Exception

Parameters

args

object[]

Returns

IAssertable

The current expectation so that you can continue the arrangement.

ThrowsAsync(Exception)

Faults the returned task with the specified exception when the arranged async call occurs.

Declaration

cs-api-definition
IAssertable ThrowsAsync(Exception exception)

Parameters

exception

Exception

Exception instance to use for the faulted task.

Returns

IAssertable

The current expectation so that you can continue the arrangement.

ThrowsAsync<TException>()

Faults the returned task with a new exception of the specified type when the arranged async call occurs.

Declaration

cs-api-definition
IAssertable ThrowsAsync<TException>() where TException : Exception

Returns

IAssertable

The current expectation so that you can continue the arrangement.

ThrowsAsync<TException>(params object[])

Faults the returned task with a new exception of the specified type when the arranged async call occurs.

Declaration

cs-api-definition
IAssertable ThrowsAsync<TException>(params object[] args) where TException : Exception

Parameters

args

object[]

Returns

IAssertable

The current expectation so that you can continue the arrangement.