@ -45,46 +45,46 @@ class FakeNiaNetworkDataSourceTest {
}
}
@Test
@Test
fun testDeserializationOfTopics ( ) = runTest ( testDispatcher ) {
fun testDeserializationOfTopics ( ) =
assertEquals (
@Suppress ( " ktlint:standard:max-line-length " )
/* ktlint-disable max-line-length */
runTest ( testDispatcher ) {
NetworkTopic (
assertEquals (
id = " 1 " ,
NetworkTopic(
name = " Headlines " ,
id = " 1 " ,
shortDescription = " News you'll definitely be interested in " ,
name = " Headlines " ,
longDescription = " The latest events and announcements from the world of Android development. " ,
shortDescription = " News you'll definitely be interested in " ,
ur l = " " ,
longDescription = " The latest events and announcements from the world of Android development. " ,
imageUrl = " https://firebasestorage.googleapis.com/v0/b/now-in-android.appspot.com/o/img%2Fic_topic_Headlines.svg?alt=media&token=506faab0-617a-4668-9e63-4a2fb996603f " ,
url = " " ,
) ,
imageUrl = " https://firebasestorage.googleapis.com/v0/b/now-in-android.appspot.com/o/img%2Fic_topic_Headlines.svg?alt=media&token=506faab0-617a-4668-9e63-4a2fb996603f " ,
/* ktlint-enable max-line-length */
) ,
subject . getTopics ( ) . first ( ) ,
subject . getTopics ( ) . first ( ) ,
)
)
}
}
@Test
@Test
fun testDeserializationOfNewsResources ( ) = runTest ( testDispatcher ) {
fun testDeserializationOfNewsResources ( ) =
assertEquals (
@Suppress ( " ktlint:standard:max-line-length " )
/* ktlint-disable max-line-length */
runTest ( testDispatcher ) {
NetworkNewsResource (
assertEquals (
id = " 125 " ,
NetworkNewsResource(
title = " Android Basics with Compose " ,
id = " 125 " ,
content = " We released the first two units of Android Basics with Compose, our first free course that teaches Android Development with Jetpack Compose to anyone; you do not need any prior programming experience other than basic computer literacy to get started. " ,
title = " Android Basics with Compose " ,
url = " https://android-developers.googleblog.com/2022/05/new-android-basics-with-compose-course.html " ,
content = " We released the first two units of Android Basics with Compose, our first free course that teaches Android Development with Jetpack Compose to anyone; you do not need any prior programming experience other than basic computer literacy to get started. " ,
headerImageUrl = " https://developer.android.com/images/hero-assets/android-basics-compose.svg " ,
url = " https://android-developers.googleblog.com/2022/05/new-android-basics-with-compose-course.html " ,
publishDate = LocalDateTime (
headerImageUrl = " https://developer.android.com/images/hero-assets/android-basics-compose.svg " ,
year = 2022 ,
publishDate = LocalDateTime (
monthNumber = 5 ,
year = 2022 ,
dayOfMonth = 4 ,
monthNumber = 5 ,
hour = 23 ,
dayOfMonth = 4 ,
minute = 0 ,
hour = 23 ,
second = 0 ,
minute = 0 ,
nano second = 0 ,
second = 0 ,
) . toInstant ( TimeZone . UTC ) ,
nanosecond = 0 ,
type = " Codelab " ,
) . toInstant ( TimeZone . UTC ) ,
topics = listOf ( " 2 " , " 3 " , " 10 " ) ,
type = " Codelab " ,
) ,
topics = listOf ( " 2 " , " 3 " , " 10 " ) ,
/* ktlint-enable max-line-length */
) ,
subject . getNewsResources ( ) . find { it . id == " 125 " } ,
subject . getNewsResources ( ) . find { it . id == " 125 " } ,
)
)
}
}
}
}