1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-21 22:05:38 -04:00

Fixed: Size Parsing in TorrentRss was a bit too tolerant.

fixes #590
This commit is contained in:
Taloth Saldono
2015-06-04 21:08:24 +02:00
parent cd5b00afa8
commit ccff4fe142
6 changed files with 891 additions and 15 deletions
@@ -14,12 +14,25 @@ namespace NzbDrone.Core.Test.IndexerTests
[TestCase("162.1MB", 169974170)]
[TestCase("398.62 MB", 417983365)]
[TestCase("845 MB", 886046720)]
public void parse_size(string sizeString, long expectedSize)
[TestCase("7,162,100.0KB", 7333990400)]
[TestCase("12341234", 12341234)]
public void should_parse_size(string sizeString, long expectedSize)
{
var result = RssParser.ParseSize(sizeString, true);
result.Should().Be(expectedSize);
}
[TestCase("100 Kbps")]
[TestCase("100 Kb/s")]
[TestCase(" 12341234")]
[TestCase("12341234 other")]
public void should_not_parse_size(string sizeString)
{
var result = RssParser.ParseSize(sizeString, true);
result.Should().Be(0);
}
}
}