mirror of
https://github.com/jellyfin/TMDbLib.git
synced 2024-11-27 07:40:24 +00:00
- Fixed up some tests
- Reduced test amount for images, now checks only 1 size pr. image
This commit is contained in:
parent
a1113d1bfa
commit
4474493645
@ -204,8 +204,8 @@ namespace TMDbLibTests
|
||||
int latestChanged = _config.Client.GetMovieLatest().Id;
|
||||
|
||||
// Fetch changelog
|
||||
DateTime lower = DateTime.UtcNow.AddDays(-14);
|
||||
DateTime higher = DateTime.UtcNow;
|
||||
DateTime lower = DateTime.UtcNow.AddDays(-13);
|
||||
DateTime higher = DateTime.UtcNow.AddDays(1);
|
||||
List<Change> respRange = _config.Client.GetMovieChanges(latestChanged, lower, higher);
|
||||
|
||||
Assert.IsNotNull(respRange);
|
||||
|
@ -1,8 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using TMDbLib.Objects.General;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Linq;
|
||||
|
||||
namespace TMDbLibTests.Helpers
|
||||
{
|
||||
@ -13,38 +12,25 @@ namespace TMDbLibTests.Helpers
|
||||
Assert.IsTrue(images.Backdrops.Count > 0);
|
||||
Assert.IsTrue(images.Posters.Count > 0);
|
||||
|
||||
Debug.WriteLine("Found {0} backdrops, {1} posters.", images.Backdrops.Count, images.Posters.Count);
|
||||
|
||||
List<string> backdropSizes = config.Client.Config.Images.BackdropSizes;
|
||||
List<string> posterSizes = config.Client.Config.Images.PosterSizes;
|
||||
|
||||
Debug.WriteLine("Found {0} backdrop sizes, {1} poster sizes.", backdropSizes.Count, posterSizes.Count);
|
||||
Debug.WriteLine("Total: {0} backdrops", images.Backdrops.Count * backdropSizes.Count);
|
||||
string backdropSizes = config.Client.Config.Images.BackdropSizes.First();
|
||||
string posterSizes = config.Client.Config.Images.PosterSizes.First();
|
||||
|
||||
foreach (ImageData imageData in images.Backdrops)
|
||||
{
|
||||
foreach (string size in backdropSizes)
|
||||
{
|
||||
Uri url = config.Client.GetImageUrl(size, imageData.FilePath);
|
||||
Uri urlSecure = config.Client.GetImageUrl(size, imageData.FilePath, true);
|
||||
Uri url = config.Client.GetImageUrl(backdropSizes, imageData.FilePath);
|
||||
Uri urlSecure = config.Client.GetImageUrl(backdropSizes, imageData.FilePath, true);
|
||||
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(url));
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(urlSecure));
|
||||
}
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(url));
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(urlSecure));
|
||||
}
|
||||
|
||||
Debug.WriteLine("Total: {0} posters", images.Posters.Count * posterSizes.Count);
|
||||
|
||||
foreach (ImageData imageData in images.Posters)
|
||||
{
|
||||
foreach (string size in posterSizes)
|
||||
{
|
||||
Uri url = config.Client.GetImageUrl(size, imageData.FilePath);
|
||||
Uri urlSecure = config.Client.GetImageUrl(size, imageData.FilePath, true);
|
||||
Uri url = config.Client.GetImageUrl(posterSizes, imageData.FilePath);
|
||||
Uri urlSecure = config.Client.GetImageUrl(posterSizes, imageData.FilePath, true);
|
||||
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(url));
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(urlSecure));
|
||||
}
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(url));
|
||||
Assert.IsTrue(TestHelpers.InternetUriExists(urlSecure));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user