From 2515867c9d491fc06a4844bbb41e0ba8bb55810c Mon Sep 17 00:00:00 2001 From: Tobi Oyelekan Date: Fri, 27 Dec 2024 02:33:17 +0100 Subject: [PATCH 1/6] add topicdao test --- .../core/database/dao/TopicDaoTest.kt | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt new file mode 100644 index 0000000000..80ed0b7210 --- /dev/null +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt @@ -0,0 +1,145 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.samples.apps.nowinandroid.core.database.dao + +import android.content.Context +import androidx.room.Room +import androidx.test.core.app.ApplicationProvider +import com.google.samples.apps.nowinandroid.core.database.NiaDatabase +import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity +import kotlinx.coroutines.flow.first +import kotlinx.coroutines.test.runTest +import org.junit.After +import org.junit.Before +import org.junit.Test +import kotlin.test.assertEquals + +class TopicDaoTest { + private lateinit var topicDao: TopicDao + private lateinit var db: NiaDatabase + + @Before + fun createDb() { + val context = ApplicationProvider.getApplicationContext() + db = Room.inMemoryDatabaseBuilder( + context, + NiaDatabase::class.java, + ).build() + topicDao = db.topicDao() + } + + @After + fun closeDb() = db.close() + + @Test + fun topicDao_fetchTopics() = runTest { + insertTopics() + + val savedTopics = topicDao.getTopicEntities().first() + + assertEquals( + listOf("1", "2", "3"), savedTopics.map { it.id }, + ) + } + + @Test + fun topicDao_getSingleTopicEntity() = runTest { + insertTopics() + + val savedTopicEntity = topicDao.getTopicEntity("2").first() + + assertEquals("performance", savedTopicEntity.name) + } + + @Test + fun topicDao_getOneOffTopicEntity() = runTest { + insertTopics() + + val savedTopics = topicDao.getOneOffTopicEntities() + + assertEquals( + listOf("1", "2", "3"), savedTopics.map { it.id }, + ) + } + + @Test + fun topicDao_getTopicEntities_ByIds() = runTest { + insertTopics() + + val savedTopics = topicDao.getTopicEntities(setOf("1", "2")) + .first() + + assertEquals(listOf("compose", "performance"), savedTopics.map { it.name }) + } + + @Test + fun topicDao_IgnoreNewEntry_If_EntityExists() = runTest { + insertTopics() + topicDao.insertOrIgnoreTopics( + listOf(testTopicEntity("1", "compose")), + ) + + val savedTopics = topicDao.getOneOffTopicEntities() + + assertEquals(3, savedTopics.size) + } + + @Test + fun topicDao_Upsert_Entities() = runTest { + insertTopics() + topicDao.upsertTopics( + listOf(testTopicEntity("1", "newName")), + ) + + val savedTopics = topicDao.getOneOffTopicEntities() + + assertEquals(3, savedTopics.size) + assertEquals("newName", savedTopics.first().name) + } + + @Test + fun topicDao_Delete_Entities() = runTest { + insertTopics() + topicDao.deleteTopics(listOf("1", "2")) + + val savedTopics = topicDao.getOneOffTopicEntities() + + assertEquals(1, savedTopics.size) + assertEquals("3", savedTopics.first().id) + } + + private suspend fun insertTopics() { + val topicEntities = listOf( + testTopicEntity("1", "compose"), + testTopicEntity("2", "performance"), + testTopicEntity("3", "headline"), + ) + topicDao.insertOrIgnoreTopics(topicEntities) + } +} + +private fun testTopicEntity( + id: String = "0", + name: String, +) = TopicEntity( + id = id, + name = name, + shortDescription = "", + longDescription = "", + url = "", + imageUrl = "", +) From 6414c4dd68c8828943b088528b342cbaa6af014c Mon Sep 17 00:00:00 2001 From: Tobi Oyelekan Date: Fri, 27 Dec 2024 02:41:12 +0100 Subject: [PATCH 2/6] extract common db setup --- .../core/database/TestDatabaseSetup.kt | 45 +++++++++++++++++++ .../core/database/dao/NewsResourceDaoTest.kt | 28 +----------- .../core/database/dao/TopicDaoTest.kt | 25 +---------- 3 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt new file mode 100644 index 0000000000..7c0d2f1e72 --- /dev/null +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.samples.apps.nowinandroid.core.database + +import android.content.Context +import androidx.room.Room +import androidx.test.core.app.ApplicationProvider +import com.google.samples.apps.nowinandroid.core.database.dao.NewsResourceDao +import com.google.samples.apps.nowinandroid.core.database.dao.TopicDao +import org.junit.After +import org.junit.Before + +abstract class TestDatabaseSetup { + protected lateinit var newsResourceDao: NewsResourceDao + protected lateinit var topicDao: TopicDao + private lateinit var db: NiaDatabase + + @Before + fun createDb() { + val context = ApplicationProvider.getApplicationContext() + db = Room.inMemoryDatabaseBuilder( + context, + NiaDatabase::class.java, + ).build() + newsResourceDao = db.newsResourceDao() + topicDao = db.topicDao() + } + + @After + fun closeDb() = db.close() +} diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt index 535ab61a77..86af0fa215 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt @@ -16,10 +16,7 @@ package com.google.samples.apps.nowinandroid.core.database.dao -import android.content.Context -import androidx.room.Room -import androidx.test.core.app.ApplicationProvider -import com.google.samples.apps.nowinandroid.core.database.NiaDatabase +import com.google.samples.apps.nowinandroid.core.database.TestDatabaseSetup import com.google.samples.apps.nowinandroid.core.database.model.NewsResourceEntity import com.google.samples.apps.nowinandroid.core.database.model.NewsResourceTopicCrossRef import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity @@ -27,31 +24,10 @@ import com.google.samples.apps.nowinandroid.core.database.model.asExternalModel import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest import kotlinx.datetime.Instant -import org.junit.After -import org.junit.Before import org.junit.Test import kotlin.test.assertEquals -class NewsResourceDaoTest { - - private lateinit var newsResourceDao: NewsResourceDao - private lateinit var topicDao: TopicDao - private lateinit var db: NiaDatabase - - @Before - fun createDb() { - val context = ApplicationProvider.getApplicationContext() - db = Room.inMemoryDatabaseBuilder( - context, - NiaDatabase::class.java, - ).build() - newsResourceDao = db.newsResourceDao() - topicDao = db.topicDao() - } - - @After - fun closeDb() = db.close() - +class NewsResourceDaoTest : TestDatabaseSetup() { @Test fun newsResourceDao_fetches_items_by_descending_publish_date() = runTest { val newsResourceEntities = listOf( diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt index 80ed0b7210..d774253e1c 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt @@ -16,35 +16,14 @@ package com.google.samples.apps.nowinandroid.core.database.dao -import android.content.Context -import androidx.room.Room -import androidx.test.core.app.ApplicationProvider -import com.google.samples.apps.nowinandroid.core.database.NiaDatabase +import com.google.samples.apps.nowinandroid.core.database.TestDatabaseSetup import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest -import org.junit.After -import org.junit.Before import org.junit.Test import kotlin.test.assertEquals -class TopicDaoTest { - private lateinit var topicDao: TopicDao - private lateinit var db: NiaDatabase - - @Before - fun createDb() { - val context = ApplicationProvider.getApplicationContext() - db = Room.inMemoryDatabaseBuilder( - context, - NiaDatabase::class.java, - ).build() - topicDao = db.topicDao() - } - - @After - fun closeDb() = db.close() - +class TopicDaoTest : TestDatabaseSetup() { @Test fun topicDao_fetchTopics() = runTest { insertTopics() From 5269e0773094a2f6b1681c99a933387073aae960 Mon Sep 17 00:00:00 2001 From: Tobi Oyelekan Date: Fri, 27 Dec 2024 02:44:10 +0100 Subject: [PATCH 3/6] format code --- .../apps/nowinandroid/core/database/dao/TopicDaoTest.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt index d774253e1c..4d78ade5d8 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt @@ -31,7 +31,8 @@ class TopicDaoTest : TestDatabaseSetup() { val savedTopics = topicDao.getTopicEntities().first() assertEquals( - listOf("1", "2", "3"), savedTopics.map { it.id }, + listOf("1", "2", "3"), + savedTopics.map { it.id }, ) } @@ -51,7 +52,8 @@ class TopicDaoTest : TestDatabaseSetup() { val savedTopics = topicDao.getOneOffTopicEntities() assertEquals( - listOf("1", "2", "3"), savedTopics.map { it.id }, + listOf("1", "2", "3"), + savedTopics.map { it.id }, ) } From 0ab0e539080b71a141e14150d032b04478fb3bcd Mon Sep 17 00:00:00 2001 From: Don Turner Date: Tue, 7 Jan 2025 12:35:12 +0000 Subject: [PATCH 4/6] Rename test methods and classes. --- .../DatabaseTest.kt} | 37 +++++++++++-------- .../core/database/dao/NewsResourceDaoTest.kt | 14 +++---- .../core/database/dao/TopicDaoTest.kt | 18 ++++----- 3 files changed, 38 insertions(+), 31 deletions(-) rename core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/{TestDatabaseSetup.kt => dao/DatabaseTest.kt} (54%) diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt similarity index 54% rename from core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt rename to core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt index 7c0d2f1e72..4bdc32606f 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/TestDatabaseSetup.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024 The Android Open Source Project + * Copyright 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,32 +14,39 @@ * limitations under the License. */ -package com.google.samples.apps.nowinandroid.core.database +package com.google.samples.apps.nowinandroid.core.database.dao import android.content.Context import androidx.room.Room import androidx.test.core.app.ApplicationProvider -import com.google.samples.apps.nowinandroid.core.database.dao.NewsResourceDao -import com.google.samples.apps.nowinandroid.core.database.dao.TopicDao +import com.google.samples.apps.nowinandroid.core.database.NiaDatabase import org.junit.After import org.junit.Before -abstract class TestDatabaseSetup { - protected lateinit var newsResourceDao: NewsResourceDao - protected lateinit var topicDao: TopicDao - private lateinit var db: NiaDatabase + +internal abstract class DatabaseTest { + + private lateinit var db : NiaDatabase + protected lateinit var newsResourceDao : NewsResourceDao + protected lateinit var topicDao : TopicDao @Before - fun createDb() { - val context = ApplicationProvider.getApplicationContext() - db = Room.inMemoryDatabaseBuilder( - context, - NiaDatabase::class.java, - ).build() + fun setup() { + db = run { + val context = ApplicationProvider.getApplicationContext() + Room.inMemoryDatabaseBuilder( + context, + NiaDatabase::class.java, + ).build() + } newsResourceDao = db.newsResourceDao() topicDao = db.topicDao() } @After - fun closeDb() = db.close() + fun closeDb(){ + db.close() + } } + + diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt index 86af0fa215..3564e2eea1 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt @@ -16,7 +16,6 @@ package com.google.samples.apps.nowinandroid.core.database.dao -import com.google.samples.apps.nowinandroid.core.database.TestDatabaseSetup import com.google.samples.apps.nowinandroid.core.database.model.NewsResourceEntity import com.google.samples.apps.nowinandroid.core.database.model.NewsResourceTopicCrossRef import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity @@ -27,9 +26,10 @@ import kotlinx.datetime.Instant import org.junit.Test import kotlin.test.assertEquals -class NewsResourceDaoTest : TestDatabaseSetup() { +internal class NewsResourceDaoTest : DatabaseTest() { + @Test - fun newsResourceDao_fetches_items_by_descending_publish_date() = runTest { + fun getNewsResources_allEntries_areOrderedByPublishDateDesc() = runTest { val newsResourceEntities = listOf( testNewsResource( id = "0", @@ -64,7 +64,7 @@ class NewsResourceDaoTest : TestDatabaseSetup() { } @Test - fun newsResourceDao_filters_items_by_news_ids_by_descending_publish_date() = runTest { + fun getNewsResources_filteredById_areOrderedByDescendingPublishDate() = runTest { val newsResourceEntities = listOf( testNewsResource( id = "0", @@ -102,7 +102,7 @@ class NewsResourceDaoTest : TestDatabaseSetup() { } @Test - fun newsResourceDao_filters_items_by_topic_ids_by_descending_publish_date() = runTest { + fun getNewsResources_filteredByTopicId_areOrderedByDescendingPublishDate() = runTest { val topicEntities = listOf( testTopicEntity( id = "1", @@ -162,7 +162,7 @@ class NewsResourceDaoTest : TestDatabaseSetup() { } @Test - fun newsResourceDao_filters_items_by_news_and_topic_ids_by_descending_publish_date() = runTest { + fun getNewsResources_filteredByIdAndTopicId_areOrderedByDescendingPublishDate() = runTest { val topicEntities = listOf( testTopicEntity( id = "1", @@ -224,7 +224,7 @@ class NewsResourceDaoTest : TestDatabaseSetup() { } @Test - fun newsResourceDao_deletes_items_by_ids() = + fun deleteNewsResources_byId() = runTest { val newsResourceEntities = listOf( testNewsResource( diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt index 4d78ade5d8..5fdae3df39 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/TopicDaoTest.kt @@ -16,16 +16,16 @@ package com.google.samples.apps.nowinandroid.core.database.dao -import com.google.samples.apps.nowinandroid.core.database.TestDatabaseSetup import com.google.samples.apps.nowinandroid.core.database.model.TopicEntity import kotlinx.coroutines.flow.first import kotlinx.coroutines.test.runTest import org.junit.Test import kotlin.test.assertEquals -class TopicDaoTest : TestDatabaseSetup() { +internal class TopicDaoTest : DatabaseTest() { + @Test - fun topicDao_fetchTopics() = runTest { + fun getTopics() = runTest { insertTopics() val savedTopics = topicDao.getTopicEntities().first() @@ -37,7 +37,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_getSingleTopicEntity() = runTest { + fun getTopic() = runTest { insertTopics() val savedTopicEntity = topicDao.getTopicEntity("2").first() @@ -46,7 +46,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_getOneOffTopicEntity() = runTest { + fun getTopics_oneOff() = runTest { insertTopics() val savedTopics = topicDao.getOneOffTopicEntities() @@ -58,7 +58,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_getTopicEntities_ByIds() = runTest { + fun getTopics_byId() = runTest { insertTopics() val savedTopics = topicDao.getTopicEntities(setOf("1", "2")) @@ -68,7 +68,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_IgnoreNewEntry_If_EntityExists() = runTest { + fun insertTopic_newEntryIsIgnoredIfAlreadyExists() = runTest { insertTopics() topicDao.insertOrIgnoreTopics( listOf(testTopicEntity("1", "compose")), @@ -80,7 +80,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_Upsert_Entities() = runTest { + fun upsertTopic_existingEntryIsUpdated() = runTest { insertTopics() topicDao.upsertTopics( listOf(testTopicEntity("1", "newName")), @@ -93,7 +93,7 @@ class TopicDaoTest : TestDatabaseSetup() { } @Test - fun topicDao_Delete_Entities() = runTest { + fun deleteTopics_byId_existingEntriesAreDeleted() = runTest { insertTopics() topicDao.deleteTopics(listOf("1", "2")) From cdc4f002a1770a693e16850f128f5a5e4a80cb62 Mon Sep 17 00:00:00 2001 From: Don Turner Date: Tue, 7 Jan 2025 12:38:49 +0000 Subject: [PATCH 5/6] Small refactor to DatabaseTest --- .../apps/nowinandroid/core/database/dao/DatabaseTest.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt index 4bdc32606f..a6514f374f 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt @@ -44,9 +44,7 @@ internal abstract class DatabaseTest { } @After - fun closeDb(){ - db.close() - } + fun teardown() = db.close() } From 249d336127b0d81399de03a508664e11002d3c50 Mon Sep 17 00:00:00 2001 From: Tobi Oyelekan Date: Tue, 7 Jan 2025 13:56:58 +0100 Subject: [PATCH 6/6] fix format --- .../apps/nowinandroid/core/database/dao/DatabaseTest.kt | 9 +++------ .../core/database/dao/NewsResourceDaoTest.kt | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt index a6514f374f..89671ba84c 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/DatabaseTest.kt @@ -23,12 +23,11 @@ import com.google.samples.apps.nowinandroid.core.database.NiaDatabase import org.junit.After import org.junit.Before - internal abstract class DatabaseTest { - private lateinit var db : NiaDatabase - protected lateinit var newsResourceDao : NewsResourceDao - protected lateinit var topicDao : TopicDao + private lateinit var db: NiaDatabase + protected lateinit var newsResourceDao: NewsResourceDao + protected lateinit var topicDao: TopicDao @Before fun setup() { @@ -46,5 +45,3 @@ internal abstract class DatabaseTest { @After fun teardown() = db.close() } - - diff --git a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt index 3564e2eea1..8f74d42e83 100644 --- a/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt +++ b/core/database/src/androidTest/kotlin/com/google/samples/apps/nowinandroid/core/database/dao/NewsResourceDaoTest.kt @@ -26,7 +26,7 @@ import kotlinx.datetime.Instant import org.junit.Test import kotlin.test.assertEquals -internal class NewsResourceDaoTest : DatabaseTest() { +internal class NewsResourceDaoTest : DatabaseTest() { @Test fun getNewsResources_allEntries_areOrderedByPublishDateDesc() = runTest {