Class TestPublisher.ManualProbe<T>
Implementation of Reactive.Streams.IPublisher{T} that allows various assertions.
This probe does not track demand.Therefore you need to expect demand before sending
elements downstream.
Inheritance
TestPublisher.ManualProbe<T>
Implements
Reactive.Streams.IPublisher<T>
Assembly: Akka.Streams.TestKit.dll
Syntax
public class ManualProbe<T> : IPublisher<T>
Type Parameters
Properties
|
Improve this Doc
View Source
AutoOnSubscribe
Declaration
public bool AutoOnSubscribe { get; }
Property Value
|
Improve this Doc
View Source
Probe
Declaration
public TestProbe Probe { get; }
Property Value
|
Improve this Doc
View Source
Publisher
Declaration
public IPublisher<T> Publisher { get; }
Property Value
Type |
Description |
Reactive.Streams.IPublisher<T> |
|
|
Improve this Doc
View Source
Subscription
Declaration
public StreamTestKit.PublisherProbeSubscription<T> Subscription { get; protected set; }
Property Value
Methods
|
Improve this Doc
View Source
AsyncBuilder()
Fluent async DSL.
This will return an instance of PublisherFluentBuilder<T> that will compose and run
all of its method call asynchronously.
Note that PublisherFluentBuilder<T> contains two types of methods:
- Methods that returns PublisherFluentBuilder<T> are used to chain test methods together
using a fluent builder pattern.
- Methods with names that ends with the postfix "Async" and returns either a Task or
a Task<TResult>. These methods invokes the previously chained methods asynchronously one
after another before executing its own code.
Declaration
public PublisherFluentBuilder<T> AsyncBuilder()
Returns
|
Improve this Doc
View Source
ExpectEvent(CancellationToken)
Expect a publisher event from the stream.
Declaration
public TestPublisher.IPublisherEvent ExpectEvent(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectEventAsync(CancellationToken)
Expect a publisher event from the stream.
Declaration
public async Task<TestPublisher.IPublisherEvent> ExpectEventAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectNoMsg(CancellationToken)
Fluent DSL
Expect no messages.
Declaration
public TestPublisher.ManualProbe<T> ExpectNoMsg(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectNoMsg(TimeSpan, CancellationToken)
Fluent DSL
Expect no messages for given duration.
Declaration
public TestPublisher.ManualProbe<T> ExpectNoMsg(TimeSpan duration, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectNoMsgAsync(CancellationToken)
Declaration
public async Task ExpectNoMsgAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectNoMsgAsync(TimeSpan, CancellationToken)
Expect no messages for given duration.
Declaration
public async Task ExpectNoMsgAsync(TimeSpan duration, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectRequest(ISubscription, Int32, CancellationToken)
Fluent DSL
Expect demand from the given subscription.
Declaration
public TestPublisher.ManualProbe<T> ExpectRequest(ISubscription subscription, int nrOfElements, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
Reactive.Streams.ISubscription |
subscription |
|
Int32 |
nrOfElements |
|
CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
ExpectRequestAsync(ISubscription, Int32, CancellationToken)
Expect demand from the given subscription.
Declaration
public async Task ExpectRequestAsync(ISubscription subscription, int nrOfElements, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type |
Name |
Description |
Reactive.Streams.ISubscription |
subscription |
|
Int32 |
nrOfElements |
|
CancellationToken |
cancellationToken |
|
Returns
|
Improve this Doc
View Source
ExpectSubscription(CancellationToken)
Declaration
public StreamTestKit.PublisherProbeSubscription<T> ExpectSubscription(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectSubscriptionAsync(CancellationToken)
Declaration
public async Task<StreamTestKit.PublisherProbeSubscription<T>> ExpectSubscriptionAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
|
Improve this Doc
View Source
ExpectSubscriptionTask(TestProbe, CancellationToken)
Declaration
protected static async Task<StreamTestKit.PublisherProbeSubscription<T>> ExpectSubscriptionTask(TestProbe probe, CancellationToken cancellationToken)
Parameters
Returns
|
Improve this Doc
View Source
ReceiveWhile<TOther>(Nullable<TimeSpan>, Nullable<TimeSpan>, Func<Object, TOther>, Int32, CancellationToken)
Receive messages for a given duration or until one does not match a given partial function.
Declaration
public IEnumerable<TOther> ReceiveWhile<TOther>(TimeSpan? max = null, TimeSpan? idle = null, Func<object, TOther> filter = null, int msgCount = 2147483647, CancellationToken cancellationToken = default(CancellationToken))
where TOther : class
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
ReceiveWhileAsync<TOther>(Nullable<TimeSpan>, Nullable<TimeSpan>, Func<Object, TOther>, Int32, CancellationToken)
Receive messages for a given duration or until one does not match a given partial function.
Declaration
public IAsyncEnumerable<TOther> ReceiveWhileAsync<TOther>(TimeSpan? max = null, TimeSpan? idle = null, Func<object, TOther> filter = null, int msgCount = 2147483647, CancellationToken cancellationToken = default(CancellationToken))
where TOther : class
Parameters
Returns
Type |
Description |
System.Collections.Generic.IAsyncEnumerable<TOther> |
|
Type Parameters
|
Improve this Doc
View Source
Subscribe(ISubscriber<T>)
Subscribes a given subscriber
to this probe.
Declaration
public void Subscribe(ISubscriber<T> subscriber)
Parameters
Type |
Name |
Description |
Reactive.Streams.ISubscriber<T> |
subscriber |
|
|
Improve this Doc
View Source
Within<TOther>(TimeSpan, Func<TOther>, CancellationToken)
Sane as calling Within(TimeSpan.Zero, max, function, cancellationToken).
Declaration
public TOther Within<TOther>(TimeSpan max, Func<TOther> execute, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
Within<TOther>(TimeSpan, TimeSpan, Func<TOther>, CancellationToken)
Declaration
public TOther Within<TOther>(TimeSpan min, TimeSpan max, Func<TOther> execute, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
Type Parameters
|
Improve this Doc
View Source
WithinAsync<TOther>(TimeSpan, Func<Task<TOther>>, CancellationToken)
Sane as calling WithinAsync(TimeSpan.Zero, max, function, cancellationToken).
Declaration
public async Task<TOther> WithinAsync<TOther>(TimeSpan max, Func<Task<TOther>> execute, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
Type |
Description |
Task<TOther> |
|
Type Parameters
|
Improve this Doc
View Source
WithinAsync<TOther>(TimeSpan, TimeSpan, Func<Task<TOther>>, CancellationToken)
Declaration
public async Task<TOther> WithinAsync<TOther>(TimeSpan min, TimeSpan max, Func<Task<TOther>> actionAsync, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Returns
Type |
Description |
Task<TOther> |
|
Type Parameters
Implements
Reactive.Streams.IPublisher<T>
Extension Methods