mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-31 20:24:27 -04:00
24 lines
858 B
C#
24 lines
858 B
C#
using System;
|
|
using System.IO;
|
|
using API.IO;
|
|
using NetVips;
|
|
using Xunit;
|
|
using Xunit.Abstractions;
|
|
|
|
namespace API.Tests.Services
|
|
{
|
|
public class ImageProviderTest
|
|
{
|
|
[Theory]
|
|
[InlineData("v10.cbz", "v10.expected.jpg")]
|
|
[InlineData("v10 - with folder.cbz", "v10 - with folder.expected.jpg")]
|
|
//[InlineData("v10 - nested folder.cbz", "v10 - nested folder.expected.jpg")]
|
|
public void GetCoverImageTest(string inputFile, string expectedOutputFile)
|
|
{
|
|
var testDirectory = Path.Join(Directory.GetCurrentDirectory(), "../../../Services/Test Data/ImageProvider");
|
|
var expectedBytes = File.ReadAllBytes(Path.Join(testDirectory, expectedOutputFile));
|
|
|
|
Assert.Equal(expectedBytes, ImageProvider.GetCoverImage(Path.Join(testDirectory, inputFile)));
|
|
}
|
|
}
|
|
} |