< Summary - AsyncResponse (Release / net8.0+net10.0 / unit+integration)

Information
Class: AsyncResponse.Transports.GooglePubSub.GooglePubSubPublisherClientAdapter
Assembly: AsyncResponse.Transports.GooglePubSub
File(s): /home/runner/work/AsyncResponse/AsyncResponse/src/Transports/AsyncResponse.Transports.GooglePubSub/GooglePubSubClientAdapters.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 37
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
PublishAsync(...)100%11100%
ShutdownAsync(...)100%11100%

File(s)

/home/runner/work/AsyncResponse/AsyncResponse/src/Transports/AsyncResponse.Transports.GooglePubSub/GooglePubSubClientAdapters.cs

#LineLine coverage
 1using Google.Cloud.PubSub.V1;
 2
 3namespace AsyncResponse.Transports.GooglePubSub;
 4
 5internal interface IGooglePubSubPublisherClient
 6{
 7    Task<string> PublishAsync(PubsubMessage message);
 8    Task ShutdownAsync(TimeSpan timeout);
 9}
 10
 311internal sealed class GooglePubSubPublisherClientAdapter(PublisherClient inner) : IGooglePubSubPublisherClient
 12{
 13    /// <summary>Publishes the supplied message.</summary>
 14    public Task<string> PublishAsync(PubsubMessage message)
 315        => inner.PublishAsync(message);
 16
 17    /// <summary>Runs the ShutdownAsync operation.</summary>
 18    public Task ShutdownAsync(TimeSpan timeout)
 319        => inner.ShutdownAsync(timeout);
 20}
 21
 22internal interface IGooglePubSubSubscriberClient
 23{
 24    Task StartAsync(Func<PubsubMessage, CancellationToken, Task<SubscriberClient.Reply>> handler);
 25    Task StopAsync(SubscriberClient.ShutdownOptions options, CancellationToken cancellationToken);
 26}
 27
 28internal sealed class GooglePubSubSubscriberClientAdapter(SubscriberClient inner) : IGooglePubSubSubscriberClient
 29{
 30    /// <summary>Starts this service.</summary>
 31    public Task StartAsync(Func<PubsubMessage, CancellationToken, Task<SubscriberClient.Reply>> handler)
 32        => inner.StartAsync(handler);
 33
 34    /// <summary>Stops this service.</summary>
 35    public Task StopAsync(SubscriberClient.ShutdownOptions options, CancellationToken cancellationToken)
 36        => inner.StopAsync(options, cancellationToken);
 37}