mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-21 22:05:38 -04:00
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user