Interface IEventFilterApplier
TBD
Namespace: Akka.TestKit
Assembly: Akka.TestKit.dll
Syntax
public interface IEventFilterApplier
Properties
| Improve this Doc 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
| Improve this Doc View SourceExpect(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | expectedCount | The expected number of events |
Action | action | The action. |
CancellationToken | cancellationToken |
Expect(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | expectedCount | The expected number of events |
TimeSpan | timeout | The time to wait for log events after executing |
Action | action | The action. |
CancellationToken | cancellationToken |
Expect<T>(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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>(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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 |
ExpectAsync(Int32, Func<Task>, Nullable<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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | expectedCount | The expected number of events |
Func<Task> | actionAsync | The async action. |
Nullable<TimeSpan> | timeout | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
ExpectAsync(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | expectedCount | The expected number of events |
Func<Task> | actionAsync | The async action. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
ExpectAsync(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | expectedCount | |
TimeSpan | timeout | |
Action | action | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
ExpectAsync(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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>(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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>(Int32, 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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Int32 | 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(CancellationToken))
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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timeout | The time to wait for a log event after executing |
Action | action | The action. |
CancellationToken | cancellationToken |
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(CancellationToken))
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(CancellationToken))
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 |
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(CancellationToken))
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(CancellationToken))
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(CancellationToken))
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(CancellationToken))
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(CancellationToken))
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 |
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();
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(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
Action | action | The function. |
CancellationToken | cancellationToken |
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(CancellationToken))
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 |
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(CancellationToken))
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(CancellationToken))
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(CancellationToken))
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 |