You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/NzbDrone.Core.Test/IndexerTests/BasicRssParserFixture.cs

38 lines
1.1 KiB

using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.IndexerTests
{
public class BasicRssParserFixture : CoreTest<RssParser>
{
[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)]
[TestCase("845 MB", 886046720)]
[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);
}
}
}