< Summary

Information
Class: TeleFlow.Telegram.Internal.Options.TelegramBotOptionsValidator
Assembly: TeleFlow.Framework
File(s): /_/src/TeleFlow.Framework/Internal/Options/TelegramBotOptionsValidator.cs
Line coverage
77%
Covered lines: 7
Uncovered lines: 2
Coverable lines: 9
Total lines: 25
Line coverage: 77.7%
Branch coverage
66%
Covered branches: 4
Total branches: 6
Branch coverage: 66.6%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
Validate(...)66.66%6677.77%

File(s)

/_/src/TeleFlow.Framework/Internal/Options/TelegramBotOptionsValidator.cs

#LineLine coverage
 1namespace TeleFlow.Telegram.Internal.Options;
 2
 3internal static class TelegramBotOptionsValidator
 4{
 5    public static void Validate(TelegramBotOptions options)
 6    {
 4817        ArgumentNullException.ThrowIfNull(options);
 8
 4819        if (options.RoleFilter is null)
 10        {
 011            throw new InvalidOperationException("Telegram role filter options must be configured.");
 12        }
 13
 48114        if (!Enum.IsDefined(options.Environment))
 15        {
 116            throw new InvalidOperationException(
 117                $"Telegram Bot API environment '{options.Environment}' is not supported.");
 18        }
 19
 48020        if (options.RoleFilter.CacheTtl <= TimeSpan.Zero)
 21        {
 022            throw new InvalidOperationException("Telegram role filter cache TTL must be greater than zero.");
 23        }
 48024    }
 25}