fix tests
Some checks failed
SonarQube / Build and analyze (push) Failing after 1m44s
Unit Tests / Run Tests (push) Failing after 1m7s

This commit is contained in:
Leonid Pershin
2025-10-20 10:39:58 +03:00
parent f4892efbb5
commit 1d0ebfeeb7
10 changed files with 73 additions and 74 deletions

View File

@@ -61,11 +61,11 @@ public class TelegramBotClientWrapperTests : UnitTestBase
// Act & Assert
var method = typeof(TelegramBotClientWrapper).GetMethod("GetMeAsync");
method.Should().NotBeNull();
method!.ReturnType.Should().Be(typeof(Task<User>));
method!.ReturnType.Should().Be<Task<User>>();
var parameters = method.GetParameters();
parameters.Should().HaveCount(1);
parameters[0].ParameterType.Should().Be(typeof(CancellationToken));
parameters[0].ParameterType.Should().Be<CancellationToken>();
parameters[0].HasDefaultValue.Should().BeTrue();
}
@@ -142,7 +142,7 @@ public class TelegramBotClientWrapperTests : UnitTestBase
var constructor = constructors[0];
var parameters = constructor.GetParameters();
parameters.Should().HaveCount(1);
parameters[0].ParameterType.Should().Be(typeof(ITelegramBotClient));
parameters[0].ParameterType.Should().Be<ITelegramBotClient>();
parameters[0].Name.Should().Be("botClient");
}
@@ -153,7 +153,7 @@ public class TelegramBotClientWrapperTests : UnitTestBase
var wrapper = new TelegramBotClientWrapper(_botClientMock.Object);
// Act & Assert
wrapper.GetType().BaseType.Should().Be(typeof(object));
wrapper.GetType().BaseType.Should().Be<object>();
}
[Fact]
@@ -179,11 +179,11 @@ public class TelegramBotClientWrapperTests : UnitTestBase
// Assert
interfaceMethods.Should().HaveCount(1);
interfaceMethods[0].Name.Should().Be("GetMeAsync");
interfaceMethods[0].ReturnType.Should().Be(typeof(Task<User>));
interfaceMethods[0].ReturnType.Should().Be<Task<User>>();
var parameters = interfaceMethods[0].GetParameters();
parameters.Should().HaveCount(1);
parameters[0].ParameterType.Should().Be(typeof(CancellationToken));
parameters[0].ParameterType.Should().Be<CancellationToken>();
parameters[0].HasDefaultValue.Should().BeTrue();
}
@@ -324,7 +324,7 @@ public class TelegramBotClientWrapperTests : UnitTestBase
// Act & Assert
getMeMethod.Should().NotBeNull();
var returnType = getMeMethod!.ReturnType;
returnType.Should().Be(typeof(Task<User>));
returnType.Should().Be<Task<User>>();
var attributes = returnType.GetCustomAttributes(false);
attributes.Should().NotBeNull();