Covers the SSD content setting with tests

Adds domain, mapping, endpoint, persistence, discovery, and hashing coverage, including parallel and sequential read behavior.
This commit is contained in:
BinaryAlley committed 2026-10-30 22:40:41 +02:00
1 parent fc800afe03
commit 45c1d1bd44
21 files changed
+354 -22

No files matched your search

@@ -32,6 +32,7 @@ public class AddMediaLibraryRequestMappingTests
canDownloadMetadataFromWeb: true,
shouldSaveMetadataInMediaDirectories: false,
shouldSkipUnchangedDirectoriesDuringScan: false,
isContentOnSsd: true,
shouldTrackConsumptionProgress: true,
completionThresholdPercentage: 90
);
@@ -49,6 +50,7 @@ public class AddMediaLibraryRequestMappingTests
Assert.Equal(request.IsLocked, result.IsLocked);
Assert.Equal(request.CanDownloadMetadataFromWeb, result.CanDownloadMetadataFromWeb);
Assert.Equal(request.ShouldSaveMetadataInMediaDirectories, result.ShouldSaveMetadataInMediaDirectories);
Assert.Equal(request.IsContentOnSsd, result.IsContentOnSsd);
Assert.Equal(request.ShouldTrackConsumptionProgress, result.ShouldTrackConsumptionProgress);
Assert.Equal(request.CompletionThresholdPercentage, result.CompletionThresholdPercentage);
}
@@ -32,7 +32,8 @@ public class LibraryEntityMappingTests
title: "My Library",
libraryType: LibraryType.Book,
contentLocations: ["C:/Books", "D:/Media/Books"],
coverImage: "D:/myPoster.jpg");
coverImage: "D:/myPoster.jpg",
isContentOnSsd: true);
// Act
LibraryResponse result = entity.ToResponse();
@@ -45,6 +46,7 @@ public class LibraryEntityMappingTests
Assert.Equal(entity.LibraryType, result.LibraryType);
Assert.Equal(entity.ContentLocations.Select(l => l.Path), result.ContentLocations);
Assert.Equal(entity.CoverImage, result.CoverImage);
Assert.Equal(entity.IsContentOnSsd, result.IsContentOnSsd);
Assert.Equal(entity.ShouldTrackConsumptionProgress, result.ShouldTrackConsumptionProgress);
Assert.Equal(entity.CompletionThresholdPercentage, result.CompletionThresholdPercentage);
Assert.Equal(entity.CreatedOnUtc, result.CreatedOnUtc);
@@ -188,6 +190,7 @@ public class LibraryEntityMappingTests
libraryType: LibraryType.Book,
contentLocations: ["C:/Books"],
coverImage: "D:/cover.jpg",
isContentOnSsd: true,
pathTemplateParts: [firstPart, secondPart]);
// Act
@@ -200,6 +203,7 @@ public class LibraryEntityMappingTests
Assert.Equal(entity.Title, result.Value.Title);
Assert.Equal(entity.LibraryType, result.Value.LibraryType);
Assert.Equal("D:/cover.jpg", result.Value.CoverImage.Value);
Assert.Equal(entity.IsContentOnSsd, result.Value.IsContentOnSsd);
Assert.Equal(entity.ShouldTrackConsumptionProgress, result.Value.ConsumptionSettings.ShouldTrackConsumptionProgress);
Assert.Equal(entity.CompletionThresholdPercentage, result.Value.ConsumptionSettings.CompletionThresholdPercentage.HasValue ? result.Value.ConsumptionSettings.CompletionThresholdPercentage.Value : null);
Assert.Equal(2, result.Value.PathTemplate.Parts.Count);
@@ -60,6 +60,7 @@ public class LibraryMappingTests
Assert.False(result.IsLocked);
Assert.True(result.CanDownloadMetadataFromWeb);
Assert.False(result.ShouldSaveMetadataInMediaDirectories);
Assert.Equal(library.IsContentOnSsd, result.IsContentOnSsd);
Assert.Equal(library.ConsumptionSettings.ShouldTrackConsumptionProgress, result.ShouldTrackConsumptionProgress);
Assert.Equal(library.ConsumptionSettings.CompletionThresholdPercentage.HasValue ? library.ConsumptionSettings.CompletionThresholdPercentage.Value : null, result.CompletionThresholdPercentage);
Assert.Equal(library.ScanIds.Select(scanId => scanId.Value), result.LibraryScans.Select(libraryScan => libraryScan.Id));
@@ -32,6 +32,7 @@ public class UpdateLibraryRequestMappingTests
canDownloadMetadataFromWeb: true,
shouldSaveMetadataInMediaDirectories: false,
shouldSkipUnchangedDirectoriesDuringScan: false,
isContentOnSsd: true,
shouldTrackConsumptionProgress: true,
completionThresholdPercentage: 90);
@@ -49,6 +50,7 @@ public class UpdateLibraryRequestMappingTests
Assert.Equal(request.CanDownloadMetadataFromWeb, result.CanDownloadMetadataFromWeb);
Assert.Equal(request.ShouldSaveMetadataInMediaDirectories, result.ShouldSaveMetadataInMediaDirectories);
Assert.Equal(request.ShouldSkipUnchangedDirectoriesDuringScan, result.ShouldSkipUnchangedDirectoriesDuringScan);
Assert.Equal(request.IsContentOnSsd, result.IsContentOnSsd);
Assert.Equal(request.ShouldTrackConsumptionProgress, result.ShouldTrackConsumptionProgress);
Assert.Equal(request.CompletionThresholdPercentage, result.CompletionThresholdPercentage);
}