Real should indicate error in parsing

This commit is contained in:
serso committed 2016-04-22 21:28:26 +02:00
1 parent b00e02a693
commit af5bf16182
7 files changed
+56 -43

No files matched your search

@@ -0,0 +1,18 @@
package org.solovyev.android.calculator.converter;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ConverterTest {
@Test(expected = NumberFormatException.class)
public void testShouldNotParseInvalidDecNumber() throws Exception {
Converter.parse("1A", 10);
}
@Test
public void testShouldParseValidHexNumber() throws Exception {
assertEquals(26, Converter.parse("1A", 16).toLong());
}
}