sonarr-repo-only/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs

38 lines
1.3 KiB
C#
Raw Normal View History

2013-04-07 22:40:13 +00:00
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.IndexerTests
{
2013-09-13 23:17:58 +00:00
public class BasicRssParserFixture : CoreTest<RssParserBase>
2013-04-07 22:40:13 +00:00
{
[TestCase("Castle.2009.S01E14.English.HDTV.XviD-LOL", "LOL")]
[TestCase("Castle 2009 S01E14 English HDTV XviD LOL", "LOL")]
[TestCase("Acropolis Now S05 EXTRAS DVDRip XviD RUNNER", "RUNNER")]
[TestCase("Punky.Brewster.S01.EXTRAS.DVDRip.XviD-RUNNER", "RUNNER")]
[TestCase("2020.NZ.2011.12.02.PDTV.XviD-C4TV", "C4TV")]
[TestCase("The.Office.S03E115.DVDRip.XviD-OSiTV", "OSiTV")]
public void parse_releaseGroup(string title, string expected)
{
2013-09-13 23:17:58 +00:00
RssParserBase.ParseReleaseGroup(title).Should().Be(expected);
2013-04-07 22:40:13 +00:00
}
[TestCase("5.64 GB", 6055903887)]
[TestCase("5.54 GiB", 5948529705)]
[TestCase("398.62 MiB", 417983365)]
[TestCase("7,162.1MB", 7510006170)]
[TestCase("162.1MB", 169974170)]
[TestCase("398.62 MB", 417983365)]
2013-07-17 07:33:54 +00:00
[TestCase("845 MB", 886046720)]
2013-04-07 22:40:13 +00:00
public void parse_size(string sizeString, long expectedSize)
{
2013-09-13 23:17:58 +00:00
var result = RssParserBase.ParseSize(sizeString);
2013-04-07 22:40:13 +00:00
result.Should().Be(expectedSize);
}
}
}