Attempt at fixing a potential bug found from #466

This commit is contained in:
tidusjar 2016-08-11 12:41:13 +01:00
commit a7d5378426
11 changed files with 222 additions and 133 deletions

View file

@ -55,6 +55,11 @@ namespace PlexRequests.Helpers.Tests
return list;
}
[TestCaseSource(nameof(SeasonNumbers))]
public int TitleToSeasonNumber(string title)
{
return PlexHelper.GetSeasonNumberFromTitle(title);
}
private static IEnumerable<TestCaseData> PlexGuids
{
@ -70,6 +75,23 @@ namespace PlexRequests.Helpers.Tests
}
}
private static IEnumerable<TestCaseData> SeasonNumbers
{
get
{
yield return new TestCaseData("Season 1").Returns(1).SetName("Season 1");
yield return new TestCaseData("Season 2").Returns(2).SetName("Season 2");
yield return new TestCaseData("Season 3").Returns(3).SetName("Season 3");
yield return new TestCaseData("Season 4").Returns(4).SetName("Season 4");
yield return new TestCaseData("Season 5").Returns(5).SetName("Season 5");
yield return new TestCaseData("Season 100").Returns(100).SetName("Season 100");
yield return new TestCaseData("InvalidSeason").Returns(0).SetName("InvalidSeason");
yield return new TestCaseData("Invalid Season with no number").Returns(0).SetName("Invalid Season with no number");
yield return new TestCaseData("").Returns(0).SetName("Empty string");
yield return new TestCaseData(null).Returns(0).SetName("Null string");
}
}
private static IEnumerable<TestCaseData> PlexTvEpisodeGuids
{
get

View file

@ -4,7 +4,7 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />