Cleanup and moved a test to proper place

This commit is contained in:
Joseph Milazzo 2021-01-25 18:22:27 -06:00
parent 165757d338
commit c57b77f092
5 changed files with 31 additions and 32 deletions

View file

@ -3,18 +3,9 @@ using Xunit;
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));
// // TODO: Implement this with ScannerService
// //Assert.Equal(expectedBytes, ImageProvider.GetCoverImage(Path.Join(testDirectory, inputFile)));
// }
}
}

View file

@ -1,7 +1,9 @@
using API.Interfaces;
using System.IO;
using API.Interfaces;
using API.Services;
using Microsoft.Extensions.Logging;
using NSubstitute;
using Xunit;
namespace API.Tests.Services
{
@ -15,6 +17,15 @@ namespace API.Tests.Services
_scannerService = new ScannerService(_unitOfWork, _logger);
}
// TODO: Start adding tests for how scanner works so we can ensure fallbacks, etc work
[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, _scannerService.GetCoverImage(Path.Join(testDirectory, inputFile)));
}
}
}