jellyfin/tests/Jellyfin.Naming.Tests/TV/TvParserHelpersTest.cs
Tim Eisele c6c48a2b47
Fix series status parsing (#11648)
* Fix series status parsing

* Apply review suggestions and add test

* Apply review suggestion

* Apply review suggestions
2024-05-16 19:06:11 +02:00

32 lines
1.0 KiB
C#

using Emby.Naming.TV;
using MediaBrowser.Model.Entities;
using Xunit;
namespace Jellyfin.Naming.Tests.TV;
public class TvParserHelpersTest
{
[Theory]
[InlineData("Ended", SeriesStatus.Ended)]
[InlineData("Cancelled", SeriesStatus.Ended)]
[InlineData("Continuing", SeriesStatus.Continuing)]
[InlineData("Returning", SeriesStatus.Continuing)]
[InlineData("Returning Series", SeriesStatus.Continuing)]
[InlineData("Unreleased", SeriesStatus.Unreleased)]
public void SeriesStatusParserTest_Valid(string statusString, SeriesStatus? status)
{
var successful = TvParserHelpers.TryParseSeriesStatus(statusString, out var parsered);
Assert.True(successful);
Assert.Equal(status, parsered);
}
[Theory]
[InlineData("XXX")]
public void SeriesStatusParserTest_InValid(string statusString)
{
var successful = TvParserHelpers.TryParseSeriesStatus(statusString, out var parsered);
Assert.False(successful);
Assert.Null(parsered);
}
}