mirror of
https://github.com/Noratrieb/ClickerGameSwing.git
synced 2026-01-15 08:05:02 +01:00
format
This commit is contained in:
parent
e36c7d258b
commit
5b021182c2
11 changed files with 230 additions and 22 deletions
42
src/test/java/LargeFormatterTest.java
Normal file
42
src/test/java/LargeFormatterTest.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class LargeFormatterTest {
|
||||
|
||||
LargeFormatter lf;
|
||||
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
lf = new LargeFormatter();
|
||||
}
|
||||
|
||||
@Test
|
||||
void tinyNumberTest(){
|
||||
double n = 0.1;
|
||||
String s = "0.10";
|
||||
assertEquals(s, lf.formatBigNumber(n));
|
||||
}
|
||||
|
||||
@Test
|
||||
void smallNumberTest(){
|
||||
double n = 10;
|
||||
String s = "10";
|
||||
assertEquals(s, lf.formatBigNumber(n));
|
||||
}
|
||||
|
||||
@Test
|
||||
void kTest(){
|
||||
double n = 1000;
|
||||
String s = "1k";
|
||||
assertEquals(s, lf.formatBigNumber(n));
|
||||
}
|
||||
|
||||
@Test
|
||||
void mTest(){
|
||||
double n = 10230000;
|
||||
String s = "10.23M";
|
||||
assertEquals(s, lf.formatBigNumber(n));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue