epfl-archive/Alpano/tests/ch/epfl/alpano/gui/FixedPointStringConverterTest.java

29 lines
735 B
Java
Raw Normal View History

2022-04-07 18:43:21 +02:00
package ch.epfl.alpano.gui;
import static org.junit.Assert.*;
import org.junit.Test;
public class FixedPointStringConverterTest {
@Test
public void testFixedPointStringConverter() {
//fail("Not yet implemented");
}
@Test
public void testFromStringString() {
FixedPointStringConverter f = new FixedPointStringConverter(4);
assertEquals(123457, (int)f.fromString("12.3456789"));
FixedPointStringConverter f1 = new FixedPointStringConverter(2);
assertEquals("1011", f1.toString(101100));
}
@Test
public void testToStringInteger() {
FixedPointStringConverter f = new FixedPointStringConverter(1);
assertEquals("67.8", f.toString(678));
}
}