< Summary

Information
Class: TeleFlow.Telegram.Internal.TelegramClient
Assembly: TeleFlow.Telegram.Client
File(s): /_/src/TeleFlow.Telegram.Client/Internal/TelegramClient.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 39
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%
SendAsync()100%11100%

File(s)

/_/src/TeleFlow.Telegram.Client/Internal/TelegramClient.cs

#LineLine coverage
 1using TeleFlow.Telegram.Schema.Abstractions;
 2
 3namespace TeleFlow.Telegram.Internal;
 4
 5internal sealed class TelegramClient : ITelegramClient
 6{
 7    private readonly ITelegramRequestExecutor _executor;
 8
 9    public TelegramClient(
 10        ITelegramRequestExecutor executor,
 11        TelegramClientOptions options,
 12        TelegramDeepLinks deepLinks)
 13    {
 30214        ArgumentNullException.ThrowIfNull(executor);
 30215        ArgumentNullException.ThrowIfNull(options);
 30216        ArgumentNullException.ThrowIfNull(deepLinks);
 17
 30218        _executor = executor;
 30219        Defaults = options.Defaults;
 20        DeepLinks = deepLinks;
 30221    }
 22
 23    public TelegramBotDefaults Defaults { get; }
 24
 25    public TelegramDeepLinks DeepLinks { get; }
 26
 27    public async Task<TResult> SendAsync<TResult>(
 28        ITelegramApiMethod<TResult> method,
 29        CancellationToken cancellationToken = default)
 30    {
 8531        ArgumentNullException.ThrowIfNull(method);
 32
 8533        var result = await _executor.ExecuteAsync(
 8534            new SchemaTelegramRequest<TResult>(method),
 8535            cancellationToken).ConfigureAwait(false);
 36
 5337        return result.Value;
 5338    }
 39}