Class InternalEventFilterApplier
Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.
Inheritance
InternalEventFilterApplier
Assembly: Akka.TestKit.dll
Syntax
public class InternalEventFilterApplier : IEventFilterApplier
Constructors
|
Edit this page
View Source
InternalEventFilterApplier(TestKitBase, ActorSystem, IReadOnlyList<EventFilterBase>)
Declaration
public InternalEventFilterApplier(TestKitBase testkit, ActorSystem system, IReadOnlyList<EventFilterBase> filters)
Parameters
Properties
|
Edit this page
View Source
And
Let's you chain more filters together. Similar to Akka JVM's filterEvents
Declaration
public EventFilterFactory And { get; }
Property Value
Methods
|
Edit this page
View Source
AwaitDone(TimeSpan, int?, MatchedEventHandler, CancellationToken)
Declaration
protected bool AwaitDone(TimeSpan timeout, int? expectedOccurrences, InternalEventFilterApplier.MatchedEventHandler matchedEventHandler, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
AwaitDoneAsync(TimeSpan, int?, MatchedEventHandler, CancellationToken)
Declaration
protected Task<bool> AwaitDoneAsync(TimeSpan timeout, int? expectedOccurrences, InternalEventFilterApplier.MatchedEventHandler matchedEventHandler, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
Expect(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
public 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 |
|
|
Edit this page
View Source
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
public 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 |
action |
The action.
|
CancellationToken |
cancellationToken |
|
|
Edit this page
View Source
ExpectAsync(int, Func<Task>, TimeSpan?, CancellationToken)
Declaration
public Task ExpectAsync(int expectedCount, Func<Task> actionAsync, TimeSpan? timeout, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectAsync(int, Func<Task>, CancellationToken)
Declaration
public Task ExpectAsync(int expectedCount, Func<Task> actionAsync, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectAsync(int, TimeSpan, Action, CancellationToken)
Declaration
public Task ExpectAsync(int expectedCount, TimeSpan timeout, Action action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectAsync(int, TimeSpan, Func<Task>, CancellationToken)
Declaration
public Task ExpectAsync(int expectedCount, TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectAsync<T>(int, Func<Task<T>>, CancellationToken)
Declaration
public Task<T> ExpectAsync<T>(int expectedCount, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
ExpectAsync<T>(int, TimeSpan, Func<Task<T>>, CancellationToken)
Async version of Expect
Note: func
might not get awaited.
Declaration
public Task<T> ExpectAsync<T>(int expectedCount, TimeSpan timeout, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
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
public void ExpectOne(Action action, CancellationToken cancellationToken = default)
Parameters
|
Edit this page
View Source
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
public 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 |
action |
The action.
|
CancellationToken |
cancellationToken |
|
|
Edit this page
View Source
ExpectOneAsync(Action, CancellationToken)
Declaration
[Obsolete("Only for backwards compat. Use ExpectOneAsync(Func<Task>, CancellationToken) instead beginning in Akka.NET v1.5")]
public Task ExpectOneAsync(Action action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectOneAsync(Func<Task>, CancellationToken)
Declaration
public Task ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectOneAsync(TimeSpan, Func<Task>, CancellationToken)
Declaration
public Task ExpectOneAsync(TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
ExpectOneAsync<T>(Func<Task<T>>, CancellationToken)
Async version of ExpectOne
Declaration
public Task<T> ExpectOneAsync<T>(Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
ExpectOneAsync<T>(TimeSpan, Func<Task<T>>, CancellationToken)
Async version of ExpectOne
Declaration
public Task<T> ExpectOneAsync<T>(TimeSpan timeout, Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
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
public T ExpectOne<T>(Func<T> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
T |
The returned value from func .
|
Type Parameters
Name |
Description |
T |
The return value of the function
|
|
Edit this page
View Source
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
public 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
|
Func<T> |
func |
The function.
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
T |
The returned value from func .
|
Type Parameters
Name |
Description |
T |
The return value of the function
|
|
Edit this page
View Source
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
public 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 func .
|
Type Parameters
Name |
Description |
T |
The return value of the function
|
|
Edit this page
View Source
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
public 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
|
Func<T> |
func |
The function.
|
CancellationToken |
cancellationToken |
|
Returns
Type |
Description |
T |
The returned value from func .
|
Type Parameters
Name |
Description |
T |
The return value of the function
|
|
Edit this page
View Source
GetMessageString(int)
Declaration
protected static string GetMessageString(int number)
Parameters
Type |
Name |
Description |
int |
number |
|
Returns
|
Edit this page
View Source
InterceptAsync<T>(Func<Task<T>>, ActorSystem, TimeSpan?, int?, MatchedEventHandler, CancellationToken)
Declaration
protected Task<T> InterceptAsync<T>(Func<Task<T>> func, ActorSystem system, TimeSpan? timeout, int? expectedOccurrences, InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
Intercept<T>(Func<T>, ActorSystem, TimeSpan?, int?, MatchedEventHandler, CancellationToken)
Declaration
protected T Intercept<T>(Func<T> func, ActorSystem system, TimeSpan? timeout, int? expectedOccurrences, InternalEventFilterApplier.MatchedEventHandler matchedEventHandler = null, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
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
public IUnmutableFilter Mute()
Returns
|
Edit this page
View Source
Mute(Action, CancellationToken)
Executes action
and prevent events from being logged during the execution.
Declaration
public void Mute(Action action, CancellationToken cancellationToken = default)
Parameters
|
Edit this page
View Source
MuteAsync(Action, CancellationToken)
Declaration
public Task MuteAsync(Action action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
MuteAsync(Func<Task>, CancellationToken)
Declaration
public Task MuteAsync(Func<Task> action, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
MuteAsync<T>(Func<Task<T>>, CancellationToken)
Declaration
public Task<T> MuteAsync<T>(Func<Task<T>> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type Parameters
|
Edit this page
View Source
Mute<T>(Func<T>, CancellationToken)
Executes func
and prevent events from being logged during the execution.
Declaration
public T Mute<T>(Func<T> func, CancellationToken cancellationToken = default)
Parameters
Returns
Type |
Description |
T |
The returned value from func .
|
Type Parameters
Name |
Description |
T |
The return value of the function
|
Implements
Extension Methods