Start of the unit tests for CoverDbService.
This commit is contained in:
parent
adf7882038
commit
4559c28ff9
3 changed files with 20 additions and 0 deletions
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
BIN
API.Tests/Services/Test Data/CoverDbService/Existing/01.webp
Normal file
BIN
API.Tests/Services/Test Data/CoverDbService/Existing/01.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Loading…
Add table
Add a link
Reference in a new issue