mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-14 11:04:17 -04:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using Kyoo.InternalAPI;
|
|
using Kyoo.InternalAPI.ThumbnailsManager;
|
|
using Kyoo.Models;
|
|
using Microsoft.Extensions.Configuration;
|
|
using NUnit.Framework;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace UnitTests.Kyoo_InternalAPI
|
|
{
|
|
public class ThumbnailsTests
|
|
{
|
|
private IConfiguration config;
|
|
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
config = new ConfigurationBuilder()
|
|
.AddJsonFile("appsettings.json")
|
|
.Build();
|
|
}
|
|
|
|
[Test]
|
|
public async Task DownloadShowImages()
|
|
{
|
|
LibraryManager library = new LibraryManager(config);
|
|
ThumbnailsManager manager = new ThumbnailsManager(config);
|
|
Show show = library.GetShowBySlug(library.GetShows().FirstOrDefault().Slug);
|
|
Debug.WriteLine("&Show: " + show.Path);
|
|
string posterPath = Path.Combine(show.Path, "poster.jpg");
|
|
File.Delete(posterPath);
|
|
|
|
await manager.Validate(show);
|
|
long posterLength = new FileInfo(posterPath).Length;
|
|
Assert.IsTrue(posterLength > 0, "Poster size is zero for the tested show (" + posterPath + ")");
|
|
}
|
|
}
|
|
}
|