< Summary

Information
Class: TeleFlow.Telegram.Webhooks.Internal.TelegramWebhookUpdateSource
Assembly: TeleFlow.Framework.Webhooks
File(s): /_/src/TeleFlow.Framework.Webhooks/Internal/TelegramWebhookUpdateSource.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 26
Line coverage: 0%
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
StartAsync()100%210%

File(s)

/_/src/TeleFlow.Framework.Webhooks/Internal/TelegramWebhookUpdateSource.cs

#LineLine coverage
 1using System.Diagnostics.CodeAnalysis;
 2using TeleFlow.Framework.Updates;
 3
 4namespace TeleFlow.Telegram.Webhooks.Internal;
 5
 6[SuppressMessage(
 7    "Performance",
 8    "CA1812:Avoid uninstantiated internal classes",
 9    Justification = "The type is instantiated by dependency injection through AddWebhook.")]
 10internal sealed class TelegramWebhookUpdateSource : IUpdateSource
 11{
 12    public async Task StartAsync(
 13        Func<IUpdatePayload, CancellationToken, Task> updateHandler,
 14        CancellationToken cancellationToken = default)
 15    {
 016        ArgumentNullException.ThrowIfNull(updateHandler);
 17
 18        try
 19        {
 020            await Task.Delay(Timeout.InfiniteTimeSpan, cancellationToken).ConfigureAwait(false);
 021        }
 022        catch (OperationCanceledException) when (cancellationToken.IsCancellationRequested)
 23        {
 024        }
 025    }
 26}

Methods/Properties

StartAsync()