This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using ChatBot.Services.Telegram.Services;
|
||||
using ChatBot.Tests.TestUtilities;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using Telegram.Bot;
|
||||
using Telegram.Bot.Types;
|
||||
using Xunit;
|
||||
|
||||
namespace ChatBot.Tests.Services.Telegram;
|
||||
|
||||
public class TelegramMessageSenderWrapperTests : UnitTestBase
|
||||
{
|
||||
private readonly Mock<ITelegramBotClient> _botClientMock;
|
||||
private readonly TelegramMessageSenderWrapper _wrapper;
|
||||
|
||||
public TelegramMessageSenderWrapperTests()
|
||||
{
|
||||
_botClientMock = TestDataBuilder.Mocks.CreateTelegramBotClient();
|
||||
_wrapper = new TelegramMessageSenderWrapper(_botClientMock.Object);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_ShouldInitializeCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
var botClient = TestDataBuilder.Mocks.CreateTelegramBotClient().Object;
|
||||
|
||||
// Act
|
||||
var wrapper = new TelegramMessageSenderWrapper(botClient);
|
||||
|
||||
// Assert
|
||||
wrapper.Should().NotBeNull();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SendMessageAsync_ShouldBePublicMethod()
|
||||
{
|
||||
// Arrange & Act
|
||||
var method = typeof(TelegramMessageSenderWrapper).GetMethod("SendMessageAsync");
|
||||
|
||||
// Assert
|
||||
method.Should().NotBeNull();
|
||||
method!.IsPublic.Should().BeTrue();
|
||||
method.ReturnType.Should().Be<Task<Message>>();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user