mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Add component tests
This commit is contained in:
parent
59123f83e6
commit
a02f586a7e
1 changed files with 32 additions and 0 deletions
|
@ -1,5 +1,37 @@
|
|||
package io.bisq.gui.components;
|
||||
|
||||
import javafx.scene.text.Text;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class ColoredDecimalPlacesWithZerosTextTest {
|
||||
|
||||
@Test
|
||||
public void testOnlyZeroDecimals() {
|
||||
ColoredDecimalPlacesWithZerosText text = new ColoredDecimalPlacesWithZerosText("1.0000");
|
||||
Text beforeZeros = (Text) text.getChildren().get(0);
|
||||
Text zeroDecimals = (Text) text.getChildren().get(1);
|
||||
assertEquals("1.0", beforeZeros.getText());
|
||||
assertEquals("000", zeroDecimals.getText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOneZeroDecimal() {
|
||||
ColoredDecimalPlacesWithZerosText text = new ColoredDecimalPlacesWithZerosText("1.2570");
|
||||
Text beforeZeros = (Text) text.getChildren().get(0);
|
||||
Text zeroDecimals = (Text) text.getChildren().get(1);
|
||||
assertEquals("1.257", beforeZeros.getText());
|
||||
assertEquals("0", zeroDecimals.getText());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultipleZeroDecimal() {
|
||||
ColoredDecimalPlacesWithZerosText text = new ColoredDecimalPlacesWithZerosText("1.2000");
|
||||
Text beforeZeros = (Text) text.getChildren().get(0);
|
||||
Text zeroDecimals = (Text) text.getChildren().get(1);
|
||||
assertEquals("1.2", beforeZeros.getText());
|
||||
assertEquals("000", zeroDecimals.getText());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue