CalDav synchronizer, new IMAP setup/edit page.

This commit is contained in:
Burak Kaan Köse
2026-02-15 02:20:18 +01:00
parent 64b9bfc392
commit acf0f649e8
58 changed files with 3993 additions and 1732 deletions
@@ -1,8 +1,4 @@
using FluentAssertions;
using Wino.Core.Domain.Entities.Shared;
using Wino.Core.Domain.Enums;
using Wino.Core.Domain.Exceptions;
using Wino.Core.Domain.Models.Connectivity;
using Wino.Core.Integration;
using Xunit;
@@ -34,50 +30,4 @@ public class ImapClientPoolTests
{
ImapClientPool.CalculateTargetMinimumConnections(maxConnections: 5, useConservativeConnections: false).Should().Be(2);
}
[Fact]
public async Task RentAsync_ShouldThrowImapClientPoolException_WhenAcquireTimesOut()
{
var serverInformation = new CustomServerInformation
{
Id = Guid.NewGuid(),
IncomingServer = "127.0.0.1",
IncomingServerPort = "1",
IncomingServerUsername = "user",
IncomingServerPassword = "password",
IncomingServerSocketOption = ImapConnectionSecurity.None,
IncomingAuthenticationMethod = ImapAuthenticationMethod.Auto,
MaxConcurrentClients = 2
};
using var pool = new ImapClientPool(ImapClientPoolOptions.CreateTestPool(serverInformation, protocolLog: null));
var act = async () => await pool.RentAsync(TimeSpan.FromMilliseconds(400));
var exception = await act.Should().ThrowAsync<ImapClientPoolException>();
exception.Which.CustomServerInformation.Should().NotBeNull();
}
[Fact]
public async Task InitializeAsync_ShouldBeSafe_WhenCalledConcurrently()
{
var serverInformation = new CustomServerInformation
{
Id = Guid.NewGuid(),
IncomingServer = "127.0.0.1",
IncomingServerPort = "1",
IncomingServerUsername = "user",
IncomingServerPassword = "password",
IncomingServerSocketOption = ImapConnectionSecurity.None,
IncomingAuthenticationMethod = ImapAuthenticationMethod.Auto,
MaxConcurrentClients = 2
};
using var pool = new ImapClientPool(ImapClientPoolOptions.CreateTestPool(serverInformation, protocolLog: null));
var init1 = pool.InitializeAsync();
var init2 = pool.InitializeAsync();
await Task.WhenAll(init1, init2);
}
}