Updated instances of assert() in LabelTest.kt to asserThat().

New imports:
 - org.hamcrest.CoreMatchers.equalTo
 - org.hamcrest.CoreMatchers.assertThat
This commit is contained in:
u7683345 2024-10-15 20:47:48 +11:00
parent 336ee946c2
commit 33af7d0d63

View file

@ -3,6 +3,8 @@ package fr.free.nrw.commons.nearby
import fr.free.nrw.commons.R import fr.free.nrw.commons.R
import org.junit.Before import org.junit.Before
import org.junit.Test import org.junit.Test
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.CoreMatchers.equalTo
class LabelTest { class LabelTest {
private lateinit var label: Label private lateinit var label: Label
@ -21,7 +23,7 @@ class LabelTest {
*/ */
@Test @Test
fun testLabelIcon() { fun testLabelIcon() {
assert(label.icon.equals(R.drawable.round_icon_church)) assertThat(label.icon, equalTo(R.drawable.round_icon_church))
} }
/** /**
@ -30,6 +32,6 @@ class LabelTest {
@Test @Test
fun testNullLabelIcon() { fun testNullLabelIcon() {
var nullLabel: Label = Label.fromText("a random text not exist in label texts") var nullLabel: Label = Label.fromText("a random text not exist in label texts")
assert(nullLabel.icon.equals(R.drawable.round_icon_unknown)) assertThat(nullLabel.icon, equalTo(R.drawable.round_icon_unknown))
} }
} }