Skip to content

Instantly share code, notes, and snippets.

@humbleshuttler
Created February 19, 2023 21:44
Show Gist options
  • Save humbleshuttler/f0f6b47257160649300fec7432031548 to your computer and use it in GitHub Desktop.
Save humbleshuttler/f0f6b47257160649300fec7432031548 to your computer and use it in GitHub Desktop.
Test for Singleton
import org.junit.jupiter.api.Test
class SingletonTest {
@Test
fun testSingleton() {
val firstDatabase = DatabaseSingleton.database()
val secondDatabase = DatabaseSingleton.database()
assert(firstDatabase == secondDatabase)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment