You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.4 KiB
46 lines
1.4 KiB
2 years ago
|
using System.IO.Abstractions;
|
||
1 year ago
|
using Recyclarr.Common;
|
||
2 years ago
|
using Recyclarr.Common.Extensions;
|
||
1 year ago
|
using Recyclarr.Repo;
|
||
1 year ago
|
using Recyclarr.TestLibrary;
|
||
1 year ago
|
using Recyclarr.TrashGuide.QualitySize;
|
||
2 years ago
|
|
||
1 year ago
|
namespace Recyclarr.IntegrationTests;
|
||
2 years ago
|
|
||
|
[TestFixture]
|
||
1 year ago
|
public class QualitySizeGuideServiceTest : IntegrationTestFixture
|
||
2 years ago
|
{
|
||
|
[TestCase(SupportedServices.Sonarr, "sonarr")]
|
||
|
[TestCase(SupportedServices.Radarr, "radarr")]
|
||
|
public void Get_data_for_service(SupportedServices service, string serviceDir)
|
||
|
{
|
||
2 years ago
|
var repo = Resolve<ITrashGuidesRepo>();
|
||
1 year ago
|
const string metadataJson =
|
||
|
"""
|
||
|
{
|
||
|
"json_paths": {
|
||
|
"radarr": {
|
||
|
"qualities": ["docs/json/radarr/quality-size"]
|
||
|
},
|
||
|
"sonarr": {
|
||
|
"qualities": ["docs/json/sonarr/quality-size"]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
""";
|
||
2 years ago
|
|
||
|
Fs.AddFile(repo.Path.File("metadata.json"), new MockFileData(metadataJson));
|
||
|
|
||
2 years ago
|
Fs.AddFileFromEmbeddedResource(
|
||
2 years ago
|
repo.Path.SubDir("docs", "json", serviceDir, "quality-size").File("some-quality-size.json"),
|
||
2 years ago
|
GetType(),
|
||
|
"Data.quality_size.json");
|
||
|
|
||
1 year ago
|
var sut = Resolve<QualitySizeGuideService>();
|
||
2 years ago
|
|
||
|
var result = sut.GetQualitySizeData(service);
|
||
|
|
||
2 years ago
|
result.Should().ContainSingle(x => x.Type == "series");
|
||
2 years ago
|
}
|
||
|
}
|