Files
Telegrator/tests/Telegrator.Tests/TestUpdateHandler.cs
T
gutii 96b3241716 * Added StartReceiving method as ITelegratoBot interface member
* Added missing summaries
* Fixed compiler warning and infos
* Code cleanup and bugfixes
2026-04-27 22:13:47 +04:00

22 lines
736 B
C#

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