29 lines
735 B
Java
29 lines
735 B
Java
|
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));
|
||
|
}
|
||
|
|
||
|
}
|