Skip to content

Commit

Permalink
Basic initialization test added
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-kew committed Jun 4, 2024
1 parent b1fec12 commit 0ef2797
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package dev.gitlive.firebase.messaging

import androidx.test.platform.app.InstrumentationRegistry
import dev.gitlive.firebase.Firebase
import dev.gitlive.firebase.FirebaseOptions
import dev.gitlive.firebase.apps
import dev.gitlive.firebase.initialize
import kotlin.test.BeforeTest

class AndroidInstrumentedFirebaseMessagingTest : FirebaseMessagingTest() {

private val context = InstrumentationRegistry.getInstrumentation().context

@BeforeTest
fun initializeFirebase() {
Firebase.apps(context).firstOrNull() ?: Firebase.initialize(
context,
FirebaseOptions(
applicationId = "1:846484016111:ios:dd1f6688bad7af768c841a",
apiKey = "AIzaSyCK87dcMFhzCz_kJVs2cT2AVlqOTLuyWV0",
databaseUrl = "https://fir-kotlin-sdk.firebaseio.com",
storageBucket = "fir-kotlin-sdk.appspot.com",
projectId = "fir-kotlin-sdk",
gcmSenderId = "846484016111"
)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.gitlive.firebase.messaging

import dev.gitlive.firebase.Firebase
import kotlin.test.Test
import kotlin.test.assertNotNull

abstract class FirebaseMessagingTest {

@Test
fun initialization() {
assertNotNull(Firebase.messaging)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package dev.gitlive.firebase.messaging

class IOSFirebaseMessagingTest : FirebaseMessagingTest()

0 comments on commit 0ef2797

Please sign in to comment.