-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathViewsTest.kt
More file actions
36 lines (32 loc) · 944 Bytes
/
ViewsTest.kt
File metadata and controls
36 lines (32 loc) · 944 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package io.sentry.android.replay.util
import android.view.View
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlin.test.Test
import kotlin.test.assertFalse
import kotlin.test.assertTrue
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class ViewsTest {
@Test
fun `hasSize returns true for positive values`() {
val view = View(ApplicationProvider.getApplicationContext())
view.right = 100
view.bottom = 100
assertTrue(view.hasSize())
}
@Test
fun `hasSize returns false for null values`() {
val view = View(ApplicationProvider.getApplicationContext())
view.right = 0
view.bottom = 0
assertFalse(view.hasSize())
}
@Test
fun `hasSize returns false for negative values`() {
val view = View(ApplicationProvider.getApplicationContext())
view.right = -1
view.bottom = -1
assertFalse(view.hasSize())
}
}