2021-05-15 15:49:04 -04:00
|
|
|
using System;
|
|
|
|
using Emby.Server.Implementations.LiveTv.EmbyTV;
|
|
|
|
using MediaBrowser.Controller.LiveTv;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Jellyfin.Server.Implementations.Tests.LiveTv
|
|
|
|
{
|
|
|
|
public static class RecordingHelperTests
|
|
|
|
{
|
2021-09-11 16:31:24 -04:00
|
|
|
public static TheoryData<string, TimerInfo> GetRecordingName_Success_TestData()
|
2021-05-15 15:49:04 -04:00
|
|
|
{
|
2021-09-11 16:31:24 -04:00
|
|
|
var data = new TheoryData<string, TimerInfo>();
|
|
|
|
|
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"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
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
2021-05-15 15:49:04 -04:00
|
|
|
|
2021-09-11 16:31:24 -04:00
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"The Incredibles (2004)",
|
|
|
|
new TimerInfo
|
|
|
|
{
|
|
|
|
Name = "The Incredibles",
|
|
|
|
IsMovie = true,
|
|
|
|
ProductionYear = 2004
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"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,
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"The Big Bang Theory S12E10",
|
|
|
|
new TimerInfo
|
|
|
|
{
|
|
|
|
Name = "The Big Bang Theory",
|
|
|
|
IsProgramSeries = true,
|
|
|
|
SeasonNumber = 12,
|
|
|
|
EpisodeNumber = 10
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"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"
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"The Big Bang Theory 2018-12-06",
|
|
|
|
new TimerInfo
|
|
|
|
{
|
|
|
|
Name = "The Big Bang Theory",
|
|
|
|
IsProgramSeries = true,
|
|
|
|
OriginalAirDate = new DateTime(2018, 12, 6)
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
2021-05-15 15:49:04 -04:00
|
|
|
|
2021-09-11 16:31:24 -04:00
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"The Big Bang Theory 2018-12-06 - The VCR Illumination",
|
|
|
|
new TimerInfo
|
|
|
|
{
|
|
|
|
Name = "The Big Bang Theory",
|
|
|
|
IsProgramSeries = true,
|
|
|
|
OriginalAirDate = new DateTime(2018, 12, 6),
|
|
|
|
EpisodeTitle = "The VCR Illumination"
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
2021-05-15 15:49:04 -04:00
|
|
|
|
2021-09-11 16:31:24 -04:00
|
|
|
data.Add(
|
2021-05-15 15:49:04 -04:00
|
|
|
"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"
|
2021-09-11 16:31:24 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
return data;
|
2021-05-15 15:49:04 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
[Theory]
|
|
|
|
[MemberData(nameof(GetRecordingName_Success_TestData))]
|
|
|
|
public static void GetRecordingName_Success(string expected, TimerInfo timerInfo)
|
|
|
|
{
|
|
|
|
Assert.Equal(expected, RecordingHelper.GetRecordingName(timerInfo));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|