static async Task CloseSinkAsync(ISink <IMessage> sink, CancellationToken token) { try { await sink.CloseAsync(token); } catch (Exception ex) { Events.SinkCloseFailed(ex); } }
public async Task SmokeTask() { var factory = new RetryingSinkFactory <int>(new TestSinkFactory <int>(), RetryPolicy.NoRetry); ISink <int> sink = await factory.CreateAsync("hub"); ISinkResult <int> result = await sink.ProcessAsync(1, CancellationToken.None); Assert.True(result.IsSuccessful); Assert.Equal(new List <int> { 1 }, result.Succeeded); Assert.False(result.Failed.Any()); Assert.False(result.InvalidDetailsList.Any()); await sink.CloseAsync(CancellationToken.None); }