2025-07-24 23:19:59 +04:00
|
|
|
using Telegram.Bot.Types;
|
|
|
|
|
using Telegrator.Handlers;
|
|
|
|
|
|
2026-04-27 22:13:47 +04:00
|
|
|
namespace Telegrator.Tests;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Вспомогательный класс для тестирования абстрактного UpdateHandlerBase.
|
|
|
|
|
/// ПРИНЦИП: Создание тестовых двойников для абстрактных классов
|
|
|
|
|
/// </summary>
|
|
|
|
|
[MessageHandler]
|
|
|
|
|
internal class TestUpdateHandler : MessageHandler
|
2025-07-24 23:19:59 +04:00
|
|
|
{
|
2026-04-27 22:13:47 +04:00
|
|
|
public bool WasExecuted { get; private set; }
|
2025-07-24 23:19:59 +04:00
|
|
|
|
2026-04-27 22:13:47 +04:00
|
|
|
public override Task<Result> Execute(IHandlerContainer<Message> container, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
cancellationToken.ThrowIfCancellationRequested();
|
|
|
|
|
WasExecuted = true;
|
|
|
|
|
return Task.FromResult(Result.Ok());
|
2025-07-24 23:19:59 +04:00
|
|
|
}
|
|
|
|
|
}
|