/app/src/test/java/com/r0adkll/deckbuilder/arch/data/features/importer/parser/DeckListParserTest.kt
https://github.com/r0adkll/DeckBox · Kotlin · 168 lines · 158 code · 10 blank · 0 comment · 0 complexity · 8969a8e59dcdc896b953db2a847ea1c9 MD5 · raw file
- package com.r0adkll.deckbuilder.arch.data.features.importer.parser
- import com.r0adkll.deckbuilder.tools.ModelUtils.EXPANSIONS
- import org.amshove.kluent.shouldEqualTo
- import org.junit.Test
- class DeckListParserTest {
- private val parser = DeckListParser()
- @Test
- fun testDefaultPtcgoDeckList() {
- val results = parser.parse(EXPANSIONS, DEFAULT_PTCGO_LIST)
- results.size.shouldEqualTo(27)
- results.sumBy { it.count }.shouldEqualTo(60)
- }
- @Test
- fun testUserDeckLists() {
- val results1 = parser.parse(EXPANSIONS, USER_TEST_DECKS[0])
- val results2 = parser.parse(EXPANSIONS, USER_TEST_DECKS[1])
- val results3 = parser.parse(EXPANSIONS, USER_TEST_DECKS[2])
- results1.size.shouldEqualTo(32)
- results2.size.shouldEqualTo(32)
- results3.size.shouldEqualTo(21)
- results1.sumBy { it.count }.shouldEqualTo(60)
- results2.sumBy { it.count }.shouldEqualTo(60)
- results3.sumBy { it.count }.shouldEqualTo(60)
- }
- companion object {
- const val DEFAULT_PTCGO_LIST = "****** Decidueye GX / Zoroark GX ******\n" +
- "\n" +
- "##Pokémon - 21\n" +
- "\n" +
- "* 1 Espeon-EX BKP 52\n" +
- "* 1 Tapu Koko PR-SM SM31\n" +
- "* 3 Zorua SLG 52\n" +
- "* 2 Zoroark-GX PR-SM SM84\n" +
- "* 4 Rowlet SUM 9\n" +
- "* 3 Dartrix SUM 10\n" +
- "* 4 Decidueye-GX SUM 12\n" +
- "* 1 Mewtwo EVO 51\n" +
- "* 1 Zoroark BKT 91\n" +
- "* 1 Tapu Lele-GX GRI 137\n" +
- "\n" +
- "##Trainer Cards - 33\n" +
- "\n" +
- "* 1 Special Charge STS 105\n" +
- "* 2 Choice Band GRI 121\n" +
- "* 1 Mallow GRI 127\n" +
- "* 2 Max Potion GRI 128\n" +
- "* 2 Guzma BUS 115\n" +
- "* 2 Brigette BKT 134\n" +
- "* 2 Float Stone BKT 137\n" +
- "* 3 Field Blower GRI 125\n" +
- "* 1 Rescue Stretcher GRI 130\n" +
- "* 3 Professor Sycamore BKP 107\n" +
- "* 3 Rare Candy SUM 129\n" +
- "* 4 Ultra Ball SUM 135\n" +
- "* 2 Evosoda GEN 62\n" +
- "* 4 N FCO 105\n" +
- "* 1 Mallow GRI 145\n" +
- "\n" +
- "##Energy - 6\n" +
- "\n" +
- "* 4 Double Colorless Energy SUM 136\n" +
- "* 2 Grass Energy EX 162\n" +
- "\n" +
- "Total Cards - 60\n" +
- "\n" +
- "****** Deck List Generated by DeckBox ******"
- val USER_TEST_DECKS = arrayOf(
- "#****** Pokémon Trading Card Game Deck List ******\n" +
- "2 Rayquaza-EX DRX 85\n" +
- "1 Victini NVI 15\n" +
- "1 Victini LTR 23\n" +
- "2 Dedenne FFI 34\n" +
- "3 Pikachu GEN 26\n" +
- "2 Raichu XY 43\n" +
- "3 Tynamo NVI 38\n" +
- "2 Eelektrik NVI 40\n" +
- "1 Zapdos LTR 46\n" +
- "1 Zapdos ROS 23\n" +
- "1 Zekrom NXD 50\n" +
- "1 Pokemon Fan Club FAC 107\n" +
- "1 N NVI 101\n" +
- "2 Skyarrow Bridge NXD 91\n" +
- "1 Professor's Letter BKT 146\n" +
- "1 Lysandre AOR 78\n" +
- "2 Professor Sycamore XY 122\n" +
- "1 Karen PR-XY XY177\n" +
- "2 Battle Compressor Team Flare Gear PHF 92\n" +
- "1 Skyla BCR 134\n" +
- "2 Level Ball AOR 76\n" +
- "1 Tierno PHF 107\n" +
- "2 Switch SUM 132\n" +
- "1 Shauna XY 127\n" +
- "1 AZ PHF 91\n" +
- "1 Bianca LTR 109\n" +
- "2 Float Stone BKT 137\n" +
- "2 Ultra Ball DEX 102\n" +
- "1 Professor Birch's Observations PRC 134\n" +
- "1 VS Seeker PHF 109\n" +
- "6 Fire Energy Energy 2\n" +
- "9 Lightning Energy Energy 4",
- "#****** Pokémon Trading Card Game Deck List ******\n" +
- "1 Articuno ROS 17\n" +
- "2 Feebas DRX 27\n" +
- "2 Milotic PRC 44\n" +
- "2 Keldeo-EX BCR 49\n" +
- "2 Lapras NXD 25\n" +
- "1 Regice AOR 24\n" +
- "1 Remoraid BKT 32\n" +
- "1 Octillery BKT 33\n" +
- "3 Squirtle BCR 29\n" +
- "2 Wartortle BCR 30\n" +
- "2 Blastoise BCR 31\n" +
- "2 Rough Seas PRC 137\n" +
- "1 N NVI 101\n" +
- "1 Archie's Ace in the Hole PRC 124\n" +
- "1 Professor's Letter BKT 146\n" +
- "1 Lysandre AOR 78\n" +
- "2 Professor Sycamore XY 122\n" +
- "1 Karen PR-XY XY177\n" +
- "1 Fisherman BKT 136\n" +
- "1 Escape Rope PRC 127\n" +
- "1 Teammates PRC 141\n" +
- "1 Skyla BCR 134\n" +
- "1 Tierno PHF 107\n" +
- "1 Shauna XY 127\n" +
- "1 Bianca LTR 109\n" +
- "2 Ultra Ball DEX 102\n" +
- "1 Professor Birch's Observations PRC 134\n" +
- "2 Dive Ball PRC 125\n" +
- "2 Rare Candy DEX 100\n" +
- "1 VS Seeker PHF 109\n" +
- "2 Superior Energy Retrieval PLF 103\n" +
- "15 Water Energy Energy 3",
- "#****** Pokémon Trading Card Game Deck List ******\n" +
- "4 Trubbish BKP 56\n" +
- "2 Garbodor BKP 57\n" +
- "2 Garbodor GRI 51\n" +
- "3 Eevee SUM 101\n" +
- "3 Espeon-GX SUM 61\n" +
- "1 Drampa-GX GRI 115\n" +
- "3 Tapu Lele-GX GRI 60\n" +
- "3 N NVI 101\n" +
- "3 Cynthia UPR 119\n" +
- "3 Guzma BUS 115\n" +
- "2 Professor Sycamore XY 122\n" +
- "2 Acerola BUS 112\n" +
- "1 Brigette BKT 134\n" +
- "4 Ultra Ball SLG 68\n" +
- "2 Field Blower GRI 125\n" +
- "1 Rescue Stretcher GRI 130\n" +
- "4 Float Stone BKT 137\n" +
- "3 Choice Band GRI 121\n" +
- "2 Parallel City BKT 145\n" +
- "8 Psychic Energy 5\n" +
- "4 Double Colorless Energy EVO 90"
- )
- }
- }