From c0dd78e7b92683ca7063b732d865a16dfc3d8c34 Mon Sep 17 00:00:00 2001 From: "Bruno R. Nunes" Date: Sun, 23 May 2021 21:23:03 -0700 Subject: [PATCH] Comments --- .../googlepay/StripeGooglePayViewModelTest.kt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/stripe/src/test/java/com/stripe/android/googlepay/StripeGooglePayViewModelTest.kt b/stripe/src/test/java/com/stripe/android/googlepay/StripeGooglePayViewModelTest.kt index dfc68b3449e..2cea75bf4aa 100644 --- a/stripe/src/test/java/com/stripe/android/googlepay/StripeGooglePayViewModelTest.kt +++ b/stripe/src/test/java/com/stripe/android/googlepay/StripeGooglePayViewModelTest.kt @@ -1,7 +1,6 @@ package com.stripe.android.googlepay import android.graphics.Color -import androidx.arch.core.executor.testing.CountingTaskExecutorRule import androidx.test.core.app.ApplicationProvider import com.google.common.truth.Truth.assertThat import com.stripe.android.ApiKeyFixtures @@ -16,10 +15,8 @@ import com.stripe.android.networking.ApiRequest import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.TestCoroutineDispatcher import org.json.JSONObject -import org.junit.Rule import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner -import java.util.concurrent.TimeUnit import kotlin.test.AfterTest import kotlin.test.BeforeTest import kotlin.test.Test @@ -31,10 +28,6 @@ class StripeGooglePayViewModelTest { private val viewModel: StripeGooglePayViewModel by lazy { createViewModel() } - @Rule - @JvmField - val countingTaskExecutorRule = CountingTaskExecutorRule() - @BeforeTest fun setup() { PaymentConfiguration.init( @@ -169,7 +162,7 @@ class StripeGooglePayViewModelTest { @Test fun `createPaymentMethod() with stripeAccount should include stripeAccount in request`() { - val stripeAccout = "account_id" + val stripeAccount = "account_id" var requestOptions: ApiRequest.Options? = null val stripeRepository = object : AbsFakeStripeRepository() { override suspend fun createPaymentMethod( @@ -183,7 +176,7 @@ class StripeGooglePayViewModelTest { val viewModel = StripeGooglePayViewModel( ApplicationProvider.getApplicationContext(), ApiKeyFixtures.FAKE_PUBLISHABLE_KEY, - stripeAccout, + stripeAccount, ARGS, stripeRepository, "App Name", @@ -195,10 +188,8 @@ class StripeGooglePayViewModelTest { ) viewModel.createPaymentMethod(params).observeForever { - assertThat(requestOptions?.stripeAccount).isEqualTo(stripeAccout) + assertThat(requestOptions?.stripeAccount).isEqualTo(stripeAccount) } - - countingTaskExecutorRule.drainTasks(3, TimeUnit.SECONDS) } private fun createViewModel(