Skip to content

Commit

Permalink
Updated according to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech committed Jul 31, 2023
1 parent c69bac4 commit c71c0ba
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,26 @@ class PersistedNameTests {
copyToRealm(
Parent().apply {
this.child = Child().apply { name = "child1" }
this.children.add(Child().apply { children.add(Child()) })
this.children.add(
Child().apply {
name = "first-child"
children.add(
Child().apply { name = "first-grand-child" }
)
}
)
}
)
}

assertEquals(1, realm.query<Parent>().count().find())
assertEquals(3, realm.query<Child>().count().find())

assertEquals("child1", realm.query<Parent>().first().find()!!.child!!.name)

val parent = realm.query<Parent>().first().find()!!
assertEquals("child1", parent.child!!.name)
val child2 = parent.children.first()
assertEquals("first-child", child2.name)
assertEquals("first-grand-child", child2.children.first().name)
}
}

Expand Down

0 comments on commit c71c0ba

Please sign in to comment.