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.
110 lines
4.1 KiB
110 lines
4.1 KiB
3 years ago
|
using System;
|
||
|
using Emby.Server.Implementations.LiveTv.EmbyTV;
|
||
|
using MediaBrowser.Controller.LiveTv;
|
||
|
using Xunit;
|
||
|
|
||
5 months ago
|
namespace Jellyfin.LiveTv.Tests
|
||
3 years ago
|
{
|
||
|
public static class RecordingHelperTests
|
||
|
{
|
||
3 years ago
|
public static TheoryData<string, TimerInfo> GetRecordingName_Success_TestData()
|
||
3 years ago
|
{
|
||
3 years ago
|
var data = new TheoryData<string, TimerInfo>();
|
||
|
|
||
|
data.Add(
|
||
3 years ago
|
"The Incredibles 2020_04_20_21_06_00",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Incredibles",
|
||
|
StartDate = new DateTime(2020, 4, 20, 21, 6, 0, DateTimeKind.Local),
|
||
|
IsMovie = true
|
||
3 years ago
|
});
|
||
3 years ago
|
|
||
3 years ago
|
data.Add(
|
||
3 years ago
|
"The Incredibles (2004)",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Incredibles",
|
||
|
IsMovie = true,
|
||
|
ProductionYear = 2004
|
||
3 years ago
|
});
|
||
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory 2020_04_20_21_06_00",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
StartDate = new DateTime(2020, 4, 20, 21, 6, 0, DateTimeKind.Local),
|
||
|
IsProgramSeries = true,
|
||
3 years ago
|
});
|
||
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory S12E10",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
IsProgramSeries = true,
|
||
|
SeasonNumber = 12,
|
||
|
EpisodeNumber = 10
|
||
3 years ago
|
});
|
||
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory S12E10 The VCR Illumination",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
IsProgramSeries = true,
|
||
|
SeasonNumber = 12,
|
||
|
EpisodeNumber = 10,
|
||
|
EpisodeTitle = "The VCR Illumination"
|
||
3 years ago
|
});
|
||
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory 2018-12-06",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
IsProgramSeries = true,
|
||
3 years ago
|
OriginalAirDate = new DateTime(2018, 12, 6, 0, 0, 0, DateTimeKind.Local)
|
||
3 years ago
|
});
|
||
3 years ago
|
|
||
3 years ago
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory 2018-12-06 - The VCR Illumination",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
IsProgramSeries = true,
|
||
3 years ago
|
OriginalAirDate = new DateTime(2018, 12, 6, 0, 0, 0, DateTimeKind.Local),
|
||
3 years ago
|
EpisodeTitle = "The VCR Illumination"
|
||
3 years ago
|
});
|
||
3 years ago
|
|
||
3 years ago
|
data.Add(
|
||
3 years ago
|
"The Big Bang Theory 2018_12_06_21_06_00 - The VCR Illumination",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "The Big Bang Theory",
|
||
|
StartDate = new DateTime(2018, 12, 6, 21, 6, 0, DateTimeKind.Local),
|
||
|
IsProgramSeries = true,
|
||
|
OriginalAirDate = new DateTime(2018, 12, 6),
|
||
|
EpisodeTitle = "The VCR Illumination"
|
||
3 years ago
|
});
|
||
|
|
||
2 years ago
|
data.Add(
|
||
|
"Lorem ipsum dolor sit amet: consect 2018_12_06_21_06_00",
|
||
|
new TimerInfo
|
||
|
{
|
||
|
Name = "Lorem ipsum dolor sit amet: consect",
|
||
|
IsProgramSeries = true,
|
||
|
StartDate = new DateTime(2018, 12, 6, 21, 6, 0, DateTimeKind.Local),
|
||
|
OriginalAirDate = new DateTime(2018, 12, 6),
|
||
|
EpisodeTitle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor"
|
||
|
});
|
||
|
|
||
3 years ago
|
return data;
|
||
3 years ago
|
}
|
||
|
|
||
|
[Theory]
|
||
|
[MemberData(nameof(GetRecordingName_Success_TestData))]
|
||
|
public static void GetRecordingName_Success(string expected, TimerInfo timerInfo)
|
||
|
{
|
||
|
Assert.Equal(expected, RecordingHelper.GetRecordingName(timerInfo));
|
||
|
}
|
||
|
}
|
||
|
}
|