add latest tests
All checks were successful
SonarQube / Build and analyze (push) Successful in 3m46s
Unit Tests / Run Tests (push) Successful in 2m21s

This commit is contained in:
Leonid Pershin
2025-10-20 09:29:08 +03:00
parent e011bb667f
commit 6c34b9cbb9
11 changed files with 2847 additions and 617 deletions

View File

@@ -12,12 +12,10 @@ namespace ChatBot.Tests.Services;
public class TelegramBotClientWrapperTests : UnitTestBase
{
private readonly Mock<ITelegramBotClient> _botClientMock;
private readonly TelegramBotClientWrapper _wrapper;
public TelegramBotClientWrapperTests()
{
_botClientMock = TestDataBuilder.Mocks.CreateTelegramBotClient();
_wrapper = new TelegramBotClientWrapper(_botClientMock.Object);
}
[Fact]
@@ -60,9 +58,6 @@ public class TelegramBotClientWrapperTests : UnitTestBase
[Fact]
public void Wrapper_ShouldHaveGetMeAsyncMethod()
{
// Arrange
var wrapper = new TelegramBotClientWrapper(_botClientMock.Object);
// Act & Assert
var method = typeof(TelegramBotClientWrapper).GetMethod("GetMeAsync");
method.Should().NotBeNull();
@@ -176,16 +171,10 @@ public class TelegramBotClientWrapperTests : UnitTestBase
public void Wrapper_ShouldHaveCorrectInterfaceMethods()
{
// Arrange
var wrapper = new TelegramBotClientWrapper(_botClientMock.Object);
var interfaceType = typeof(ITelegramBotClientWrapper);
// Act
var interfaceMethods = interfaceType.GetMethods();
var wrapperMethods = wrapper
.GetType()
.GetMethods()
.Where(m => m.DeclaringType == wrapper.GetType())
.ToArray();
// Assert
interfaceMethods.Should().HaveCount(1);