mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-14 10:36:54 -07:00
parent
605f6f18fb
commit
14fddfc118
19 changed files with 953 additions and 541 deletions
|
@ -36,11 +36,25 @@ namespace PlexRequests.Helpers.Tests
|
|||
public class PlexHelperTests
|
||||
{
|
||||
[TestCaseSource(nameof(PlexGuids))]
|
||||
public string CreateUriWithSubDir(string guid)
|
||||
public string GetProviderId(string guid)
|
||||
{
|
||||
return PlexHelper.GetProviderIdFromPlexGuid(guid);
|
||||
}
|
||||
|
||||
[TestCaseSource(nameof(PlexTvEpisodeGuids))]
|
||||
public List<string> GetEpisodeAndSeasons(string guid)
|
||||
{
|
||||
var ep = PlexHelper.GetSeasonsAndEpisodesFromPlexGuid(guid);
|
||||
var list = new List<string>
|
||||
{
|
||||
ep.ProviderId,
|
||||
ep.SeasonNumber.ToString(),
|
||||
ep.EpisodeNumber.ToString(),
|
||||
};
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<TestCaseData> PlexGuids
|
||||
{
|
||||
|
@ -56,6 +70,17 @@ namespace PlexRequests.Helpers.Tests
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
private static IEnumerable<TestCaseData> PlexTvEpisodeGuids
|
||||
{
|
||||
get
|
||||
{
|
||||
yield return new TestCaseData("com.plexapp.agents.thetvdb://269586/2/8?lang=en").Returns(new List<string> { "269586","2","8" })
|
||||
.SetName("Valid");
|
||||
yield return new TestCaseData("com.plexapp.agents.thetvdb://abc/112/388?lang=en").Returns(new List<string> { "abc", "112","388" })
|
||||
.SetName("Valid Long");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue