Skip to content

Commit 96ccf89

Browse files
authored
Merge pull request #242 from thejoeba/add-database-reference-testing
Add database reference testing
2 parents 8d83005 + f67d1c1 commit 96ccf89

File tree

1 file changed

+15
-0
lines changed
  • firebase-database/src/commonTest/kotlin/dev.gitlive.firebase.database

1 file changed

+15
-0
lines changed

firebase-database/src/commonTest/kotlin/dev.gitlive.firebase.database/database.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ class FirebaseDatabaseTest {
3838
}
3939
}
4040

41+
@Test
42+
fun testSetValue() = runTest {
43+
val testValue = "test"
44+
val testReference = Firebase.database.reference("testPath")
45+
46+
testReference.setValue(testValue)
47+
48+
val testReferenceValue = testReference
49+
.valueEvents
50+
.first()
51+
.value<String>()
52+
53+
assertEquals(testValue, testReferenceValue)
54+
}
55+
4156
@Test
4257
fun testChildCount() = runTest {
4358
setupRealtimeData()

0 commit comments

Comments
 (0)