From 6759aba7b22a5944b9aefce1766148e3e2908420 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 14 Nov 2026 18:59:36 -0600 Subject: test for duplicated filenames, different sizes --- .../Transfers/Downloads/DownloadService/EnqueueAsyncTests.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/slskd.Tests.Unit/Transfers/Downloads/DownloadService/EnqueueAsyncTests.cs b/tests/slskd.Tests.Unit/Transfers/Downloads/DownloadService/EnqueueAsyncTests.cs index 11edf035..6c1cb963 100644 --- a/tests/slskd.Tests.Unit/Transfers/Downloads/DownloadService/EnqueueAsyncTests.cs +++ b/tests/slskd.Tests.Unit/Transfers/Downloads/DownloadService/EnqueueAsyncTests.cs @@ -242,6 +242,17 @@ public partial class DownloadServiceTests Assert.Empty(fixture.Records()); } + [Fact] + public async Task Throws_ArgumentException_When_Filenames_Are_Duplicated_With_Different_Sizes() + { + using var fixture = new Fixture(); + + var ex = await Record.ExceptionAsync(() => fixture.Service.EnqueueAsync(Username, [(Filename, Size), (Filename, Size + 1)])); + + Assert.Contains("duplicated", Assert.IsType(ex).Message); + Assert.Empty(fixture.Records()); + } + [Fact] public async Task Rethrows_When_User_Endpoint_Lookup_Fails() { -- cgit v1.2.3