diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
commit | 754de6bb0449a577d2bb9c28cca6adf0ef9554f6 (patch) | |
tree | 279b405d94e0d86d10ed94bd34d919457944ead6 /src/test/java/de | |
parent | cd633f13b8d7327e47994bb5a000f0c0b7089e7f (diff) |
relates FS#241: Implementation of http download based on okhttp
Diffstat (limited to 'src/test/java/de')
-rw-r--r-- | src/test/java/de/thedevstack/conversationsplus/utils/UIHelperTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/java/de/thedevstack/conversationsplus/utils/UIHelperTest.java b/src/test/java/de/thedevstack/conversationsplus/utils/UIHelperTest.java new file mode 100644 index 00000000..2409413d --- /dev/null +++ b/src/test/java/de/thedevstack/conversationsplus/utils/UIHelperTest.java @@ -0,0 +1,29 @@ +package de.thedevstack.conversationsplus.utils; + +import org.junit.Test; +import static org.junit.Assert.assertEquals; + +/** + * + */ +public class UIHelperTest { + @Test + public void testGetHumanReadableDetailedFileSizeBytes() { + String result = UIHelper.getHumanReadableDetailedFileSize(1); + assertEquals("1 bytes", result); + result = UIHelper.getHumanReadableDetailedFileSize(120); + assertEquals("120 bytes", result); + result = UIHelper.getHumanReadableDetailedFileSize(1023); + assertEquals("1023 bytes", result); + } + + @Test + public void testGetHumanReadableDetailedFileSizeKilobytes() { + String result = UIHelper.getHumanReadableDetailedFileSize(1024); + assertEquals("1 kb", result); + result = UIHelper.getHumanReadableDetailedFileSize(120); + assertEquals("120 bytes", result); + result = UIHelper.getHumanReadableDetailedFileSize(1023); + assertEquals("1023 bytes", result); + } +} |