< Summary

Information
Class: TeleFlow.Telegram.Internal.TelegramRawLongPollingLogFormatter
Assembly: TeleFlow.Telegram.LongPolling
File(s): /_/src/TeleFlow.Telegram.LongPolling/Internal/TelegramRawLongPollingLogFormatter.cs
Line coverage
46%
Covered lines: 6
Uncovered lines: 7
Coverable lines: 13
Total lines: 40
Line coverage: 46.1%
Branch coverage
20%
Covered branches: 2
Total branches: 10
Branch coverage: 20%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FormatAllowedUpdates(...)50%22100%
GetUpdateType(...)12.5%30830%

File(s)

/_/src/TeleFlow.Telegram.LongPolling/Internal/TelegramRawLongPollingLogFormatter.cs

#LineLine coverage
 1using TeleFlow.Telegram.Schema.Types;
 2
 3namespace TeleFlow.Telegram.Internal;
 4
 5internal static class TelegramRawLongPollingLogFormatter
 6{
 7    public static string FormatAllowedUpdates(IReadOnlyList<string>? allowedUpdates)
 8    {
 29        return allowedUpdates is null
 210            ? "unset"
 211            : string.Join(",", allowedUpdates);
 12    }
 13
 14    public static string GetUpdateType(Update update)
 15    {
 216        ArgumentNullException.ThrowIfNull(update);
 17
 218        if (update.Message is not null)
 19        {
 220            return "message";
 21        }
 22
 023        if (update.CallbackQuery is not null)
 24        {
 025            return "callback_query";
 26        }
 27
 028        if (update.MyChatMember is not null)
 29        {
 030            return "my_chat_member";
 31        }
 32
 033        if (update.ChatMember is not null)
 34        {
 035            return "chat_member";
 36        }
 37
 038        return "unknown";
 39    }
 40}