mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-01-13 08:15:20 +07:00
Created compcode schema and table tests
This commit is contained in:
parent
322f238a0c
commit
f24869411a
17
core/src/main/java/com/riiablo/table/schema/CompCode.java
Normal file
17
core/src/main/java/com/riiablo/table/schema/CompCode.java
Normal file
@ -0,0 +1,17 @@
|
||||
package com.riiablo.table.schema;
|
||||
|
||||
import com.riiablo.table.annotation.PrimaryKey;
|
||||
import com.riiablo.table.annotation.Schema;
|
||||
|
||||
@Schema
|
||||
public class CompCode {
|
||||
@Override
|
||||
public String toString() {
|
||||
return component;
|
||||
}
|
||||
|
||||
public String component;
|
||||
|
||||
@PrimaryKey
|
||||
public String code;
|
||||
}
|
@ -27,6 +27,7 @@ import com.riiablo.table.table.ArmTypeTable;
|
||||
import com.riiablo.table.table.BodyLocsTable;
|
||||
import com.riiablo.table.table.CharStatsTable;
|
||||
import com.riiablo.table.table.ColorsTable;
|
||||
import com.riiablo.table.table.CompCodeTable;
|
||||
import com.riiablo.table.table.ItemStatCostTable;
|
||||
import com.riiablo.table.table.MagicPrefixTable;
|
||||
import com.riiablo.table.table.MagicSuffixTable;
|
||||
@ -486,4 +487,23 @@ public class TablesTest extends RiiabloTest {
|
||||
Assert.assertEquals("DYEL", table.get(14).Code);
|
||||
Assert.assertEquals("LGLD", table.get(15).Code);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void compCode() {
|
||||
LogManager.setLevel("com.riiablo.table.table.CompCodeTable", Level.TRACE);
|
||||
TableManifest.compcode.parser = null;
|
||||
FileHandle handle = Gdx.files.internal("test/compcode.txt");
|
||||
CompCodeTable table = Tables.loadTsv(TableManifest.compcode, handle);
|
||||
Assert.assertEquals("NIL", table.get(0).code);
|
||||
Assert.assertEquals("LIT", table.get(1).code);
|
||||
Assert.assertEquals("MED", table.get(2).code);
|
||||
Assert.assertEquals("HEV", table.get(3).code);
|
||||
Assert.assertEquals("HVY", table.get(4).code);
|
||||
Assert.assertEquals("DES", table.get(5).code);
|
||||
Assert.assertEquals("WND", table.get(17).code);
|
||||
Assert.assertEquals("CLM", table.get(47).code);
|
||||
Assert.assertEquals("BLD", table.get(57).code);
|
||||
Assert.assertEquals("ZZ1", table.get(70).code);
|
||||
Assert.assertEquals("HED", table.get(114).code);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user