< Summary

Information
Class: TeleFlow.Telegram.Internal.TelegramKeyboardPlaceholderValidator
Assembly: TeleFlow.Framework
File(s): /_/src/TeleFlow.Framework/Internal/TelegramKeyboardPlaceholderValidator.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 30
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ValidateReplyKeyboardInputFieldPlaceholder(...)100%11100%
ValidateForceReplyInputFieldPlaceholder(...)100%11100%
ValidateInputFieldPlaceholder(...)100%22100%

File(s)

/_/src/TeleFlow.Framework/Internal/TelegramKeyboardPlaceholderValidator.cs

#LineLine coverage
 1namespace TeleFlow.Telegram.Internal;
 2
 3internal static class TelegramKeyboardPlaceholderValidator
 4{
 5    private const int InputFieldPlaceholderLimit = 64;
 6
 7    public static void ValidateReplyKeyboardInputFieldPlaceholder(string placeholder)
 8    {
 29        ValidateInputFieldPlaceholder(
 210            placeholder,
 211            "Reply keyboard input placeholder must be at most 64 characters.");
 112    }
 13
 14    public static void ValidateForceReplyInputFieldPlaceholder(string placeholder)
 15    {
 316        ValidateInputFieldPlaceholder(
 317            placeholder,
 318            "Force reply input placeholder must be at most 64 characters.");
 219    }
 20
 21    private static void ValidateInputFieldPlaceholder(string placeholder, string limitMessage)
 22    {
 523        ArgumentException.ThrowIfNullOrWhiteSpace(placeholder);
 24
 525        if (placeholder.Length > InputFieldPlaceholderLimit)
 26        {
 227            throw new ArgumentException(limitMessage, nameof(placeholder));
 28        }
 329    }
 30}