Fixed: Consistent display of sizes

Closes #709
This commit is contained in:
kmcc049
2015-08-30 09:49:06 +12:00
parent 30bcc662bc
commit 07b70f9d3f
5 changed files with 24 additions and 20 deletions
@@ -8,13 +8,15 @@ namespace NzbDrone.Common.Test.ExtensionTests
public class Int64ExtensionFixture
{
[TestCase(0, "0 B")]
[TestCase(1000, "1.0 KB")]
[TestCase(1000000, "1.0 MB")]
[TestCase(377487360, "377.5 MB")]
[TestCase(1255864686, "1.3 GB")]
[TestCase(-1000000, "-1.0 MB")]
[TestCase(-377487360, "-377.5 MB")]
[TestCase(-1255864686, "-1.3 GB")]
[TestCase(1000, "1,000.0 B")]
[TestCase(1024, "1.0 KB")]
[TestCase(1000000, "976.6 KB")]
[TestCase(377487360, "360.0 MB")]
[TestCase(1255864686, "1.2 GB")]
[TestCase(-1024, "-1.0 KB")]
[TestCase(-1000000, "-976.6 KB")]
[TestCase(-377487360, "-360.0 MB")]
[TestCase(-1255864686, "-1.2 GB")]
public void should_calculate_string_correctly(long bytes, string expected)
{
bytes.SizeSuffix().Should().Be(expected);