24 lines
797 B
C#
24 lines
797 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 Execute(IAbstractHandlerContainer<Message> container, CancellationToken cancellationToken)
|
||
|
|
{
|
||
|
|
cancellationToken.ThrowIfCancellationRequested();
|
||
|
|
WasExecuted = true;
|
||
|
|
return Task.CompletedTask;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|