Added base10 and base11

This commit is contained in:
Willem Cazander 2022-02-01 12:12:06 +01:00
parent 69fc75b1af
commit ed938585df
8 changed files with 214 additions and 7 deletions

View file

@ -21,9 +21,6 @@ public class BasePartFactoryTest {
Assertions.assertNotNull(bases);
Assertions.assertTrue(bases.length > 1);
Assertions.assertTrue(bases.length < 100);
for (int base:bases) {
Assertions.assertNotNull(base);
}
}
@Test

View file

@ -0,0 +1,38 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T10PartDecimalTest {
@Test
public void testBasePart() {
for (T10PartDecimal value:T10PartDecimal.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@Test
public void testToneMap() {
Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfTone("˥"));
Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfTone("˦"));
Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfTone(""));
Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfTone(""));
}
@Test
public void testChinaMap() {
Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfChina(""));
}
}

View file

@ -0,0 +1,38 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T11PartUndecimalTest {
@Test
public void testBasePart() {
for (T11PartUndecimal value:T11PartUndecimal.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@Test
public void testToneMap() {
Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfTone("˥"));
Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfTone(""));
Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfTone(""));
Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfTone("˩"));
}
@Test
public void testChinaMap() {
Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfChina(""));
}
}