Files
android-sms-gateway/app/src/test/java/com/androidsmsgateway/sms/SmsStatusReceiverTest.kt
T
2026-08-25 02:18:50 +03:30

25 lines
684 B
Kotlin

package com.androidsmsgateway.sms
import android.app.Activity
import android.telephony.SmsManager
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class SmsStatusReceiverTest {
@Test
fun `activity result ok is successful`() {
assertTrue(SmsStatusReceiver.isSuccessfulResult(Activity.RESULT_OK))
}
@Test
fun `sms manager no error is successful`() {
assertTrue(SmsStatusReceiver.isSuccessfulResult(SmsManager.RESULT_ERROR_NONE))
}
@Test
fun `sms manager error is not successful`() {
assertFalse(SmsStatusReceiver.isSuccessfulResult(SmsManager.RESULT_ERROR_GENERIC_FAILURE))
}
}