Files
Telegrator/Telegrator.Tests/TestUpdateHandler.cs
T
Rikitav 16d11990ec * Added Result class to communicate with router from handler
* Removed "ExecuteOnlyFirstFoundHanlder" in sake of testing new Result pattern based routing system
* Removed obsolete option property "DescendDescriptorIndex"
* Changed router logic
* Changed handlers pool logic
2025-08-02 02:32:38 +04:00

24 lines
815 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(IAbstractHandlerContainer<Message> container, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
WasExecuted = true;
return Task.FromResult(Result.Ok());
}
}
}