Start of the unit tests for CoverDbService.

This commit is contained in:
Joseph Milazzo 2025-05-03 07:54:22 -05:00
parent adf7882038
commit 4559c28ff9
3 changed files with 20 additions and 0 deletions

View file

@ -28,6 +28,7 @@
<ItemGroup>
<Folder Include="Services\Test Data\ArchiveService\ComicInfos" />
<Folder Include="Services\Test Data\CoverDbService\" />
<Folder Include="Services\Test Data\ImageService\Covers\" />
</ItemGroup>

View file

@ -1,9 +1,28 @@
using System.Threading.Tasks;
using API.Services;
using API.Services.Tasks.Metadata;
using API.SignalR;
using EasyCaching.Core;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using NSubstitute;
namespace API.Tests.Services;
public class CoverDbServiceTests : AbstractDbTest
{
private readonly IDirectoryService _directoryService;
private readonly IEasyCachingProviderFactory _cacheFactory = Substitute.For<IEasyCachingProviderFactory>();
private readonly ICoverDbService _coverDbService;
public CoverDbServiceTests()
{
_directoryService = new DirectoryService(Substitute.For<ILogger<DirectoryService>>(), CreateFileSystem());
var imageService = new ImageService(Substitute.For<ILogger<ImageService>>(), _directoryService);
_coverDbService = new CoverDbService(Substitute.For<ILogger<CoverDbService>>(), _directoryService, _cacheFactory,
Substitute.For<IHostEnvironment>(), imageService, UnitOfWork, Substitute.For<IEventHub>());
}
protected override Task ResetDb()
{
throw new System.NotImplementedException();

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB