25 lines
684 B
Kotlin
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))
|
|
}
|
|
}
|