feat: Full rework to support both Kotlin and Java and make it work like the Other SDKs (#2)

This commit is contained in:
2022-05-04 15:25:49 +02:00
committed by GitHub
parent 82aaf7cb01
commit 7ad76513e0
56 changed files with 2126 additions and 1789 deletions

View File

@@ -0,0 +1,52 @@
package net.tcgdex.sdk
import java.io.IOException
import kotlin.test.Test
import kotlin.test.BeforeTest
import kotlin.test.assertNotNull
class APITest {
private lateinit var api: TCGdex
@BeforeTest
fun initAPI() {
api = TCGdex("en")
}
@Test
@Throws(IOException::class)
fun testFullCardInfo() {
assertNotNull(api.fetchCards())
assertNotNull(api.fetchCard("swsh3-136"))
assertNotNull(api.fetchCard("swsh3", "136"))
assertNotNull(api.fetchSet("swsh3"))
assertNotNull(api.fetchSets())
assertNotNull(api.fetchSerie("swsh"))
assertNotNull(api.fetchSeries())
assertNotNull(api.fetchTypes())
assertNotNull(api.fetchType("Colorless"))
assertNotNull(api.fetchRetreats())
assertNotNull(api.fetchRetreat("1"))
assertNotNull(api.fetchRarities())
assertNotNull(api.fetchRarity("Uncommon"))
assertNotNull(api.fetchIllustrators())
assertNotNull(api.fetchIllustrator("tetsuya koizumi"))
assertNotNull(api.fetchHPs())
assertNotNull(api.fetchHP("110"))
assertNotNull(api.fetchCategories())
assertNotNull(api.fetchCategory("Pokemon"))
assertNotNull(api.fetchDexIds())
assertNotNull(api.fetchDexId("162"))
assertNotNull(api.fetchEnergyTypes())
assertNotNull(api.fetchEnergyType("Special"))
assertNotNull(api.fetchRegulationMarks())
assertNotNull(api.fetchRegulationMark("D"))
assertNotNull(api.fetchStages())
assertNotNull(api.fetchStage("Basic"))
assertNotNull(api.fetchSuffixes())
assertNotNull(api.fetchSuffix("EX"))
assertNotNull(api.fetchTrainerTypes())
assertNotNull(api.fetchTrainerType("Tool"))
assertNotNull(api.fetchVariants())
assertNotNull(api.fetchVariant("holo"))
}
}