Interface IEventFilterApplier
TBD
Namespace: Akka.TestKit
Assembly: Akka.TestKit.dll
Syntax
public interface IEventFilterApplier
Properties
| Edit this page View SourceAnd
Let's you chain more filters together. Similar to Akka JVM's filterEvents
Declaration
EventFilterFactory And { get; }
Property Value
| Type | Description |
|---|---|
| EventFilterFactory |
Methods
| Edit this page View SourceExpect(int, Action, CancellationToken)
Executes action and expects the specified number
of events to be logged during the execution.
This method fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
void Expect(int expectedCount, Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| Action | action | The action. |
| CancellationToken | cancellationToken |
Expect(int, TimeSpan, Action, CancellationToken)
Executes action and expects the specified number
of events to be logged during the execution.
This method fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
void Expect(int expectedCount, TimeSpan timeout, Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| TimeSpan | timeout | The time to wait for log events after executing |
| Action | action | The action. |
| CancellationToken | cancellationToken |
ExpectAsync(int, Func<Task>, TimeSpan?, CancellationToken)
Executes actionAsync task and expects the specified number
of events to be logged during the execution.
This method fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task ExpectAsync(int expectedCount, Func<Task> actionAsync, TimeSpan? timeout, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| Func<Task> | actionAsync | The async action. |
| TimeSpan? | timeout | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectAsync(int, Func<Task>, CancellationToken)
Executes actionAsync task and expects the specified number
of events to be logged during the execution.
This method fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task ExpectAsync(int expectedCount, Func<Task> actionAsync, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| Func<Task> | actionAsync | The async action. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectAsync(int, TimeSpan, Action, CancellationToken)
Declaration
[Obsolete("Use ExpectAsync<T>(expectedCount, TimeSpan, Func<Task<T>>) instead. This method only exists to support backwards compatibility as of Akka.NET v1.5.")]
Task ExpectAsync(int expectedCount, TimeSpan timeout, Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | |
| TimeSpan | timeout | |
| Action | action | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectAsync(int, TimeSpan, Func<Task>, CancellationToken)
Executes action and expects the specified number
of events to be logged during the execution.
This method fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task ExpectAsync(int expectedCount, TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| TimeSpan | timeout | The time to wait for log events after executing |
| Func<Task> | action | The action. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectAsync<T>(int, Func<Task<T>>, CancellationToken)
Executes func and expects the specified number
of events to be logged during the execution.
This function fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Note: func might not get awaited.
Declaration
Task<T> ExpectAsync<T>(int expectedCount, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| Func<Task<T>> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<T> | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
ExpectAsync<T>(int, TimeSpan, Func<Task<T>>, CancellationToken)
Executes func and expects the specified number
of events to be logged during the execution.
This function fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task<T> ExpectAsync<T>(int expectedCount, TimeSpan timeout, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| TimeSpan | timeout | The time to wait for log events after executing |
| Func<Task<T>> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<T> | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
ExpectOne(Action, CancellationToken)
Executes action and
expects one event to be logged during the execution.
This method fails and throws an exception if more than one event is logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
void ExpectOne(Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | The action. |
| CancellationToken | cancellationToken |
ExpectOne(TimeSpan, Action, CancellationToken)
Executes action and
expects one event to be logged during the execution.
This method fails and throws an exception if more than one event is logged,
or if a timeout occurs.
Declaration
void ExpectOne(TimeSpan timeout, Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeout | The time to wait for a log event after executing |
| Action | action | The action. |
| CancellationToken | cancellationToken |
ExpectOneAsync(Action, CancellationToken)
Declaration
[Obsolete("Only for backwards compat. Use ExpectOneAsync(Func<Task>, CancellationToken) instead beginning in Akka.NET v1.5")]
Task ExpectOneAsync(Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectOneAsync(Func<Task>, CancellationToken)
Executes actionAsync and
expects one event to be logged during the execution.
This method fails and throws an exception if more than one event is logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task ExpectOneAsync(Func<Task> actionAsync, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task> | actionAsync | The action. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectOneAsync(TimeSpan, Func<Task>, CancellationToken)
Executes action and
expects one event to be logged during the execution.
This method fails and throws an exception if more than one event is logged,
or if a timeout occurs.
Declaration
Task ExpectOneAsync(TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeout | The time to wait for a log event after executing |
| Func<Task> | action | The action. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
ExpectOneAsync<T>(Func<Task<T>>, CancellationToken)
Executes func and
expects one event to be logged during the execution.
This function fails and throws an exception if more than one event is logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
Task<T> ExpectOneAsync<T>(Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<T> | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
ExpectOneAsync<T>(TimeSpan, Func<Task<T>>, CancellationToken)
Executes func and
expects one event to be logged during the execution.
This function fails and throws an exception if more than one event is logged,
or if a timeout occurs.
Declaration
Task<T> ExpectOneAsync<T>(TimeSpan timeout, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeout | The time to wait for a log event after executing |
| Func<Task<T>> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<T> | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
ExpectOne<T>(Func<T>, CancellationToken)
Executes func and
expects one event to be logged during the execution.
This function fails and throws an exception if more than one event is logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
T ExpectOne<T>(Func<T> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| T | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
ExpectOne<T>(TimeSpan, Func<T>, CancellationToken)
Executes func and
expects one event to be logged during the execution.
This function fails and throws an exception if more than one event is logged,
or if a timeout occurs.
Declaration
T ExpectOne<T>(TimeSpan timeout, Func<T> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | timeout | The time to wait for a log event after executing |
| Func<T> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| T | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
Expect<T>(int, Func<T>, CancellationToken)
Executes func and expects the specified number
of events to be logged during the execution.
This function fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
T Expect<T>(int expectedCount, Func<T> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| Func<T> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| T | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
Expect<T>(int, TimeSpan, Func<T>, CancellationToken)
Executes func and expects the specified number
of events to be logged during the execution.
This function fails and throws an exception if more events than expected are logged,
or if a timeout occurs. The timeout is taken from the config value
"akka.test.filter-leeway", see TestEventFilterLeeway.
Declaration
T Expect<T>(int expectedCount, TimeSpan timeout, Func<T> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| int | expectedCount | The expected number of events |
| TimeSpan | timeout | The time to wait for log events after executing |
| Func<T> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| T | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
Mute()
Prevents events from being logged from now on. To allow events to be logged again, call
Unmute() on the returned object.
var filter = EventFilter.Debug().Mute();
...
filter.Unmute();
You may also use it like this:
using(EventFilter.Debug().Mute())
{
...
}
Declaration
IUnmutableFilter Mute()
Returns
| Type | Description |
|---|---|
| IUnmutableFilter | TBD |
Mute(Action, CancellationToken)
Executes action and prevent events from being logged during the execution.
Declaration
void Mute(Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | The function. |
| CancellationToken | cancellationToken |
MuteAsync(Action, CancellationToken)
Declaration
[Obsolete("Use MuteAsync(Func<Task>) instead. This method only exists for backwards compatibility as of Akka.NET v1.5.0.")]
Task MuteAsync(Action action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
MuteAsync(Func<Task>, CancellationToken)
Executes action and prevent events from being logged during the execution.
Declaration
Task MuteAsync(Func<Task> action, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task> | action | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task | The returned value from |
MuteAsync<T>(Func<Task<T>>, CancellationToken)
Executes func and prevent events from being logged during the execution.
Declaration
Task<T> MuteAsync<T>(Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<Task<T>> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<T> | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
Mute<T>(Func<T>, CancellationToken)
Executes func and prevent events from being logged during the execution.
Declaration
T Mute<T>(Func<T> func, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<T> | func | The function. |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| T | The returned value from |
Type Parameters
| Name | Description |
|---|---|
| T | The return value of the function |
Edit this page