fixes
All checks were successful
SonarQube / Build and analyze (push) Successful in 2m57s

This commit is contained in:
Leonid Pershin
2025-10-22 03:28:48 +03:00
parent 1996fec14f
commit 0e5c418a0e
8 changed files with 492 additions and 64 deletions

View File

@@ -22,7 +22,7 @@ public class ISessionStorageTests : UnitTestBase
// GetOrCreateAsync method
var getOrCreateMethod = methods.FirstOrDefault(m => m.Name == "GetOrCreateAsync");
getOrCreateMethod.Should().NotBeNull();
getOrCreateMethod!.ReturnType.Should().Be(typeof(Task<ChatSession>));
getOrCreateMethod!.ReturnType.Should().Be<Task<ChatSession>>();
getOrCreateMethod.GetParameters().Should().HaveCount(3);
getOrCreateMethod.GetParameters()[0].ParameterType.Should().Be<long>();
getOrCreateMethod.GetParameters()[1].ParameterType.Should().Be<string>();
@@ -31,14 +31,14 @@ public class ISessionStorageTests : UnitTestBase
// GetAsync method
var getMethod = methods.FirstOrDefault(m => m.Name == "GetAsync");
getMethod.Should().NotBeNull();
getMethod!.ReturnType.Should().Be(typeof(Task<ChatSession?>));
getMethod!.ReturnType.Should().Be<Task<ChatSession?>>();
getMethod.GetParameters().Should().HaveCount(1);
getMethod.GetParameters()[0].ParameterType.Should().Be<long>();
// RemoveAsync method
var removeMethod = methods.FirstOrDefault(m => m.Name == "RemoveAsync");
removeMethod.Should().NotBeNull();
removeMethod!.ReturnType.Should().Be(typeof(Task<bool>));
removeMethod!.ReturnType.Should().Be<Task<bool>>();
removeMethod.GetParameters().Should().HaveCount(1);
removeMethod.GetParameters()[0].ParameterType.Should().Be<long>();
@@ -47,13 +47,13 @@ public class ISessionStorageTests : UnitTestBase
m.Name == "GetActiveSessionsCountAsync"
);
getActiveSessionsCountMethod.Should().NotBeNull();
getActiveSessionsCountMethod!.ReturnType.Should().Be(typeof(Task<int>));
getActiveSessionsCountMethod!.ReturnType.Should().Be<Task<int>>();
getActiveSessionsCountMethod.GetParameters().Should().BeEmpty();
// CleanupOldSessionsAsync method
var cleanupOldSessionsMethod = methods.FirstOrDefault(m => m.Name == "CleanupOldSessionsAsync");
cleanupOldSessionsMethod.Should().NotBeNull();
cleanupOldSessionsMethod!.ReturnType.Should().Be(typeof(Task<int>));
cleanupOldSessionsMethod!.ReturnType.Should().Be<Task<int>>();
cleanupOldSessionsMethod.GetParameters().Should().HaveCount(1);
cleanupOldSessionsMethod.GetParameters()[0].ParameterType.Should().Be<int>();