parent
9f5333645e
commit
f8b0404cc3
1 changed files with 5 additions and 5 deletions
|
@ -3,7 +3,7 @@ package app.aaps.plugins.automation.elements
|
||||||
import app.aaps.shared.tests.TestBase
|
import app.aaps.shared.tests.TestBase
|
||||||
import dagger.android.AndroidInjector
|
import dagger.android.AndroidInjector
|
||||||
import dagger.android.HasAndroidInjector
|
import dagger.android.HasAndroidInjector
|
||||||
import org.junit.jupiter.api.Assertions
|
import com.google.common.truth.Truth.assertThat
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|
||||||
class LayoutBuilderTest : TestBase() {
|
class LayoutBuilderTest : TestBase() {
|
||||||
|
@ -14,15 +14,15 @@ class LayoutBuilderTest : TestBase() {
|
||||||
val layoutBuilder = LayoutBuilder()
|
val layoutBuilder = LayoutBuilder()
|
||||||
val inputInsulin = InputInsulin()
|
val inputInsulin = InputInsulin()
|
||||||
layoutBuilder.add(inputInsulin)
|
layoutBuilder.add(inputInsulin)
|
||||||
Assertions.assertEquals(1, layoutBuilder.mElements.size)
|
assertThat(layoutBuilder.mElements).hasSize(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test fun addConditionalTest() {
|
@Test fun addConditionalTest() {
|
||||||
val layoutBuilder = LayoutBuilder()
|
val layoutBuilder = LayoutBuilder()
|
||||||
val inputInsulin = InputInsulin()
|
val inputInsulin = InputInsulin()
|
||||||
layoutBuilder.maybeAdd(inputInsulin, true)
|
layoutBuilder.maybeAdd(inputInsulin, true)
|
||||||
Assertions.assertEquals(1, layoutBuilder.mElements.size)
|
assertThat(layoutBuilder.mElements).hasSize(1)
|
||||||
layoutBuilder.maybeAdd(inputInsulin, false)
|
layoutBuilder.maybeAdd(inputInsulin, false)
|
||||||
Assertions.assertEquals(1, layoutBuilder.mElements.size)
|
assertThat(layoutBuilder.mElements).hasSize(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue