From f8b0404cc38f142f83966a120e4c05d658c930a3 Mon Sep 17 00:00:00 2001 From: Ryan Haining Date: Wed, 4 Oct 2023 20:56:31 -0700 Subject: [PATCH] Rewrites LayoutBuilderTest with matchers Issue #2745 --- .../plugins/automation/elements/LayoutBuilderTest.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/elements/LayoutBuilderTest.kt b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/elements/LayoutBuilderTest.kt index ab0cae1c6d..c76f25a83e 100644 --- a/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/elements/LayoutBuilderTest.kt +++ b/plugins/automation/src/test/kotlin/app/aaps/plugins/automation/elements/LayoutBuilderTest.kt @@ -3,7 +3,7 @@ package app.aaps.plugins.automation.elements import app.aaps.shared.tests.TestBase import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector -import org.junit.jupiter.api.Assertions +import com.google.common.truth.Truth.assertThat import org.junit.jupiter.api.Test class LayoutBuilderTest : TestBase() { @@ -14,15 +14,15 @@ class LayoutBuilderTest : TestBase() { val layoutBuilder = LayoutBuilder() val inputInsulin = InputInsulin() layoutBuilder.add(inputInsulin) - Assertions.assertEquals(1, layoutBuilder.mElements.size) + assertThat(layoutBuilder.mElements).hasSize(1) } @Test fun addConditionalTest() { val layoutBuilder = LayoutBuilder() val inputInsulin = InputInsulin() layoutBuilder.maybeAdd(inputInsulin, true) - Assertions.assertEquals(1, layoutBuilder.mElements.size) + assertThat(layoutBuilder.mElements).hasSize(1) layoutBuilder.maybeAdd(inputInsulin, false) - Assertions.assertEquals(1, layoutBuilder.mElements.size) + assertThat(layoutBuilder.mElements).hasSize(1) } -} \ No newline at end of file +}