Search Results for

    Show / Hide Table of Contents

    Interface IEventFilterApplier

    TBD

    Namespace: Akka.TestKit
    Assembly: Akka.TestKit.dll
    Syntax
    public interface IEventFilterApplier

    Properties

    | Edit this page View Source

    And

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

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

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

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

    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 action

    Func<Task> action

    The action.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    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 func.

    Type Parameters
    Name Description
    T

    The return value of the function

    | Edit this page View Source

    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

    Func<Task<T>> func

    The function.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>

    The returned value from func.

    Type Parameters
    Name Description
    T

    The return value of the function

    | 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
    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
    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")]
    Task ExpectOneAsync(Action action, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Action action
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

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

    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 action

    Func<Task> action

    The action.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Edit this page View Source

    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 func.

    Type Parameters
    Name Description
    T

    The return value of the function

    | Edit this page View Source

    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

    Func<Task<T>> func

    The function.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>

    The returned value from func.

    Type Parameters
    Name Description
    T

    The return value of the function

    | 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
    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
    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
    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
    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

    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

    | Edit this page View Source

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

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

    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 action.

    | Edit this page View Source

    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 func.

    Type Parameters
    Name Description
    T

    The return value of the function

    | Edit this page View Source

    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 func.

    Type Parameters
    Name Description
    T

    The return value of the function

    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