16d11990ec
* Removed "ExecuteOnlyFirstFoundHanlder" in sake of testing new Result pattern based routing system * Removed obsolete option property "DescendDescriptorIndex" * Changed router logic * Changed handlers pool logic
24 lines
815 B
C#
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());
|
|
}
|
|
}
|
|
}
|