[skip ci] Fix unit tests on macOS (And probably Unix) (#3647)

This commit is contained in:
Fesaa 2025-03-19 11:13:05 +00:00 committed by GitHub
parent e897fb9a12
commit 98a2b9d3ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 154 additions and 172 deletions

View file

@ -32,18 +32,13 @@ using Xunit.Abstractions;
namespace API.Tests.Services;
public class ReaderServiceTests
public class ReaderServiceTests: AbstractFsTest
{
private readonly ITestOutputHelper _testOutputHelper;
private readonly IUnitOfWork _unitOfWork;
private readonly DataContext _context;
private readonly ReaderService _readerService;
private const string CacheDirectory = "C:/kavita/config/cache/";
private const string CoverImageDirectory = "C:/kavita/config/covers/";
private const string BackupDirectory = "C:/kavita/config/backups/";
private const string DataDirectory = "C:/data/";
public ReaderServiceTests(ITestOutputHelper testOutputHelper)
{
_testOutputHelper = testOutputHelper;
@ -101,19 +96,6 @@ public class ReaderServiceTests
await _context.SaveChangesAsync();
}
private static MockFileSystem CreateFileSystem()
{
var fileSystem = new MockFileSystem();
fileSystem.Directory.SetCurrentDirectory("C:/kavita/");
fileSystem.AddDirectory("C:/kavita/config/");
fileSystem.AddDirectory(CacheDirectory);
fileSystem.AddDirectory(CoverImageDirectory);
fileSystem.AddDirectory(BackupDirectory);
fileSystem.AddDirectory(DataDirectory);
return fileSystem;
}
#endregion
#region FormatBookmarkFolderPath