Search Results for

    Show / Hide Table of Contents

    Class InternalEventFilterApplier

    Note! Part of internal API. Breaking changes may occur without notice. Use at own risk.

    Inheritance
    object
    InternalEventFilterApplier
    Implements
    IEventFilterApplier
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.TestKit.Internal
    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
    Type Name Description
    TestKitBase testkit
    ActorSystem system
    IReadOnlyList<EventFilterBase> filters

    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
    Type Description
    EventFilterFactory

    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
    Type Name Description
    TimeSpan timeout
    int? expectedOccurrences
    InternalEventFilterApplier.MatchedEventHandler matchedEventHandler
    CancellationToken cancellationToken
    Returns
    Type Description
    bool
    | Edit this page View Source

    AwaitDoneAsync(TimeSpan, int?, MatchedEventHandler, CancellationToken)

    Async version of AwaitDone(TimeSpan, int?, MatchedEventHandler, CancellationToken)

    Declaration
    protected Task<bool> AwaitDoneAsync(TimeSpan timeout, int? expectedOccurrences, InternalEventFilterApplier.MatchedEventHandler matchedEventHandler, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan timeout
    int? expectedOccurrences
    InternalEventFilterApplier.MatchedEventHandler matchedEventHandler
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>
    | 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)

    Async version of Expect

    Declaration
    public Task ExpectAsync(int expectedCount, Func<Task> actionAsync, TimeSpan? timeout, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    int expectedCount
    Func<Task> actionAsync
    TimeSpan? timeout
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectAsync(int, Func<Task>, CancellationToken)

    Async version of Expect

    Declaration
    public Task ExpectAsync(int expectedCount, Func<Task> actionAsync, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    int expectedCount
    Func<Task> actionAsync
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectAsync(int, TimeSpan, Action, CancellationToken)

    Declaration
    public 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
    | Edit this page View Source

    ExpectAsync(int, TimeSpan, Func<Task>, CancellationToken)

    Async version of Expect(int, TimeSpan, Action, CancellationToken)

    Declaration
    public Task ExpectAsync(int expectedCount, TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    int expectedCount
    TimeSpan timeout
    Func<Task> action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectAsync<T>(int, Func<Task<T>>, CancellationToken)

    Async version of Expect

    Declaration
    public Task<T> ExpectAsync<T>(int expectedCount, Func<Task<T>> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    int expectedCount
    Func<Task<T>> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    int expectedCount
    TimeSpan timeout
    Func<Task<T>> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    Action action

    The action.

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

    Async version of ExpectOne(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
    Type Name Description
    Action action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    Remarks

    This is for backwards compat.

    | Edit this page View Source

    ExpectOneAsync(Func<Task>, CancellationToken)

    Async version of ExpectOne(Action, CancellationToken)

    Declaration
    public Task ExpectOneAsync(Func<Task> action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task> action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    ExpectOneAsync(TimeSpan, Func<Task>, CancellationToken)

    Async version of ExpectOne(TimeSpan, Action, CancellationToken)

    Declaration
    public Task ExpectOneAsync(TimeSpan timeout, Func<Task> action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    TimeSpan timeout
    Func<Task> action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | 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
    Type Name Description
    Func<Task<T>> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    TimeSpan timeout
    Func<Task<T>> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    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

    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
    Type Description
    string
    | Edit this page View Source

    InterceptAsync<T>(Func<Task<T>>, ActorSystem, TimeSpan?, int?, MatchedEventHandler, CancellationToken)

    Async version of Intercept<T>(Func<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
    Type Name Description
    Func<Task<T>> func
    ActorSystem system
    TimeSpan? timeout
    int? expectedOccurrences
    InternalEventFilterApplier.MatchedEventHandler matchedEventHandler
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    Func<T> func
    ActorSystem system
    TimeSpan? timeout
    int? expectedOccurrences
    InternalEventFilterApplier.MatchedEventHandler matchedEventHandler
    CancellationToken cancellationToken
    Returns
    Type Description
    T
    Type Parameters
    Name Description
    T
    | 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
    Type Description
    IUnmutableFilter

    TBD

    | 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
    Type Name Description
    Action action

    The function.

    CancellationToken cancellationToken
    | Edit this page View Source

    MuteAsync(Action, CancellationToken)

    Declaration
    public Task MuteAsync(Action action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Action action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    MuteAsync(Func<Task>, CancellationToken)

    Async version of Mute

    Declaration
    public Task MuteAsync(Func<Task> action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task> action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    MuteAsync<T>(Func<Task<T>>, CancellationToken)

    Async version of Mute

    Declaration
    public Task<T> MuteAsync<T>(Func<Task<T>> func, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Func<Task<T>> func
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>
    Type Parameters
    Name Description
    T
    | 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
    Type Name Description
    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

    Implements

    IEventFilterApplier

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET