Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/recyclarr/blame/commit/cb56ab5737ff6fc8f607c7826804e8705f90a12a/tests/Recyclarr.IntegrationTests/QualitySizeGuideParserTest.cs You should set ROOT_URL correctly, otherwise the web may not work correctly.
recyclarr/tests/Recyclarr.IntegrationTests/QualitySizeGuideParserTest.cs

49 lines
1.3 KiB

using System.IO.Abstractions;
using Recyclarr.TestLibrary;
using Recyclarr.TrashGuide.QualitySize;
namespace Recyclarr.IntegrationTests;
[TestFixture]
public class QualitySizeGuideParserTest : IntegrationTestFixture
{
[Test]
public void Get_valid_data()
{
var qualityDir = Fs.CurrentDirectory().SubDirectory("json");
Fs.AddSameFileFromEmbeddedResource(qualityDir.File("quality_size.json"), GetType());
qualityDir.Refresh();
var sut = Resolve<QualitySizeGuideParser>();
var result = sut.GetQualities(new[] {qualityDir});
result.Should().BeEquivalentTo(new[]
{
new QualitySizeData
{
Type = "series",
Qualities = new[]
{
new QualitySizeItem("quality1", 1, 2, 3),
new QualitySizeItem("quality2", 4.1m, 5.1m, 6.1m)
}
}
});
}
[Test]
public void Invalid_data_gets_skipped()
{
var qualityDir = Fs.CurrentDirectory().SubDirectory("json");
Fs.AddSameFileFromEmbeddedResource(qualityDir.File("invalid_quality_size.json"), GetType());
qualityDir.Refresh();
var sut = Resolve<QualitySizeGuideParser>();
var result = sut.GetQualities(new[] {qualityDir});
result.Should().BeEmpty();
}
}