try adding tests
parent
6e46248301
commit
2bb71cfb1c
|
|
@ -1,3 +1,5 @@
|
|||
@file:Suppress("UnstableApiUsage")
|
||||
|
||||
plugins {
|
||||
`java-library`
|
||||
kotlin("jvm")
|
||||
|
|
@ -7,3 +9,11 @@ plugins {
|
|||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
testing {
|
||||
suites {
|
||||
val test by getting(JvmTestSuite::class) {
|
||||
useKotlinTest(embeddedKotlinVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
package de.itkl.modConfiguration.loaders
|
||||
|
||||
import com.sksamuel.hoplite.ConfigLoaderBuilder
|
||||
import de.itkl.modConfiguration.types.Account
|
||||
import java.nio.file.Path
|
||||
|
||||
fun loadAccounts(path: Path): Map<String, Account> {
|
||||
return ConfigLoaderBuilder.default()
|
||||
.build()
|
||||
.loadConfigOrThrow()
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package de.itkl.modConfiguration
|
||||
|
||||
import org.koin.dsl.module
|
||||
|
||||
val modConfiguration = module {}
|
||||
|
|
@ -1,3 +1,8 @@
|
|||
package de.itkl.modConfiguration.types
|
||||
|
||||
class Account
|
||||
interface Account {
|
||||
val name: String
|
||||
val password: String
|
||||
}
|
||||
|
||||
data class AccountDef(override val name: String, override val password: String) : Account
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
package de.itkl.modConfiguration.types
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
package de.itkl.modConfiguration.loaders
|
||||
|
||||
class AccountLoaderTests {
|
||||
@Test
|
||||
fun testAccountLoad() {}
|
||||
}
|
||||
Loading…
Reference in New Issue