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

@@ -22,47 +22,47 @@ public class ISessionStorageTests : UnitTestBase
// GetOrCreate method
var getOrCreateMethod = methods.FirstOrDefault(m => m.Name == "GetOrCreate");
getOrCreateMethod.Should().NotBeNull();
getOrCreateMethod!.ReturnType.Should().Be(typeof(ChatSession));
getOrCreateMethod!.ReturnType.Should().Be<ChatSession>();
getOrCreateMethod.GetParameters().Should().HaveCount(3);
getOrCreateMethod.GetParameters()[0].ParameterType.Should().Be(typeof(long));
getOrCreateMethod.GetParameters()[1].ParameterType.Should().Be(typeof(string));
getOrCreateMethod.GetParameters()[2].ParameterType.Should().Be(typeof(string));
getOrCreateMethod.GetParameters()[0].ParameterType.Should().Be<long>();
getOrCreateMethod.GetParameters()[1].ParameterType.Should().Be<string>();
getOrCreateMethod.GetParameters()[2].ParameterType.Should().Be<string>();
// Get method
var getMethod = methods.FirstOrDefault(m => m.Name == "Get");
getMethod.Should().NotBeNull();
getMethod!.ReturnType.Should().Be(typeof(ChatSession));
getMethod!.ReturnType.Should().Be<ChatSession>();
getMethod.GetParameters().Should().HaveCount(1);
getMethod.GetParameters()[0].ParameterType.Should().Be(typeof(long));
getMethod.GetParameters()[0].ParameterType.Should().Be<long>();
// Remove method
var removeMethod = methods.FirstOrDefault(m => m.Name == "Remove");
removeMethod.Should().NotBeNull();
removeMethod!.ReturnType.Should().Be(typeof(bool));
removeMethod!.ReturnType.Should().Be<bool>();
removeMethod.GetParameters().Should().HaveCount(1);
removeMethod.GetParameters()[0].ParameterType.Should().Be(typeof(long));
removeMethod.GetParameters()[0].ParameterType.Should().Be<long>();
// GetActiveSessionsCount method
var getActiveSessionsCountMethod = methods.FirstOrDefault(m =>
m.Name == "GetActiveSessionsCount"
);
getActiveSessionsCountMethod.Should().NotBeNull();
getActiveSessionsCountMethod!.ReturnType.Should().Be(typeof(int));
getActiveSessionsCountMethod!.ReturnType.Should().Be<int>();
getActiveSessionsCountMethod.GetParameters().Should().BeEmpty();
// CleanupOldSessions method
var cleanupOldSessionsMethod = methods.FirstOrDefault(m => m.Name == "CleanupOldSessions");
cleanupOldSessionsMethod.Should().NotBeNull();
cleanupOldSessionsMethod!.ReturnType.Should().Be(typeof(int));
cleanupOldSessionsMethod!.ReturnType.Should().Be<int>();
cleanupOldSessionsMethod.GetParameters().Should().HaveCount(1);
cleanupOldSessionsMethod.GetParameters()[0].ParameterType.Should().Be(typeof(int));
cleanupOldSessionsMethod.GetParameters()[0].ParameterType.Should().Be<int>();
// SaveSessionAsync method
var saveSessionAsyncMethod = methods.FirstOrDefault(m => m.Name == "SaveSessionAsync");
saveSessionAsyncMethod.Should().NotBeNull();
saveSessionAsyncMethod!.ReturnType.Should().Be(typeof(Task));
saveSessionAsyncMethod!.ReturnType.Should().Be<Task>();
saveSessionAsyncMethod.GetParameters().Should().HaveCount(1);
saveSessionAsyncMethod.GetParameters()[0].ParameterType.Should().Be(typeof(ChatSession));
saveSessionAsyncMethod.GetParameters()[0].ParameterType.Should().Be<ChatSession>();
}
[Fact]