|
|
@ -158,12 +158,18 @@ class SQLiteHabitListTest : BaseUnitTest() {
|
|
|
|
habitList.remove(h!!)
|
|
|
|
habitList.remove(h!!)
|
|
|
|
assertThat(habitList.indexOf(h), equalTo(-1))
|
|
|
|
assertThat(habitList.indexOf(h), equalTo(-1))
|
|
|
|
|
|
|
|
|
|
|
|
habitList.add(h)
|
|
|
|
var rec = repository.find(2L)
|
|
|
|
val primaryOrder = habitList.primaryOrder
|
|
|
|
assertNull(rec)
|
|
|
|
|
|
|
|
rec = repository.find(3L)!!
|
|
|
|
|
|
|
|
assertThat(rec.position, equalTo(1))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
|
|
|
fun testRemove_orderByName() {
|
|
|
|
habitList.primaryOrder = HabitList.Order.BY_NAME_DESC
|
|
|
|
habitList.primaryOrder = HabitList.Order.BY_NAME_DESC
|
|
|
|
habitList.remove(h)
|
|
|
|
val h = habitList.getById(2)
|
|
|
|
|
|
|
|
habitList.remove(h!!)
|
|
|
|
assertThat(habitList.indexOf(h), equalTo(-1))
|
|
|
|
assertThat(habitList.indexOf(h), equalTo(-1))
|
|
|
|
habitList.primaryOrder = primaryOrder
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var rec = repository.find(2L)
|
|
|
|
var rec = repository.find(2L)
|
|
|
|
assertNull(rec)
|
|
|
|
assertNull(rec)
|
|
|
|