mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
assorted: move getbytes to parseutil and add tests (#14076)
This commit is contained in:
@@ -39,6 +39,19 @@ namespace Jackett.Test.Common.Utils
|
||||
description.Value.Should().Contain("Know Your Role and Shut Your Mouth!");
|
||||
}
|
||||
|
||||
[TestCase("1023.4 KB", 1047961)]
|
||||
[TestCase("1023.4 MB", 1073112704)]
|
||||
[TestCase("1,023.4 MB", 1073112704)]
|
||||
[TestCase("1.023,4 MB", 1073112704)]
|
||||
[TestCase("1 023,4 MB", 1073112704)]
|
||||
[TestCase("1.023.4 MB", 1073112704)]
|
||||
[TestCase("1023.4 GB", 1098867408896)]
|
||||
[TestCase("1023.4 TB", 1125240226709504)]
|
||||
public void should_parse_size(string stringSize, long size)
|
||||
{
|
||||
ParseUtil.GetBytes(stringSize).Should().Be(size);
|
||||
}
|
||||
|
||||
[TestCase(" some string ", "some string")]
|
||||
public void should_normalize_multiple_spaces(string original, string newString)
|
||||
{
|
||||
|
Reference in New Issue
Block a user