package pl.firmatpp.kierowca.data.upload

import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test

class PhotoUploadStatusTest {
    @Test
    fun onlyConfirmedStatusIsStoredOnServer() {
        assertFalse(PhotoUploadStatus.Pending.isStoredOnServer)
        assertFalse(PhotoUploadStatus.Uploading.isStoredOnServer)
        assertFalse(PhotoUploadStatus.Verifying.isStoredOnServer)
        assertFalse(PhotoUploadStatus.FailedRetryable.isStoredOnServer)
        assertFalse(PhotoUploadStatus.FailedPermanent.isStoredOnServer)
        assertFalse(PhotoUploadStatus.Cancelled.isStoredOnServer)
        assertTrue(PhotoUploadStatus.Confirmed.isStoredOnServer)
    }

    @Test
    fun statusLabelsMakeUnconfirmedStateExplicit() {
        assertEquals("Czeka na wysłanie", PhotoUploadStatus.Pending.label)
        assertEquals("Wysyłam zdjęcie", PhotoUploadStatus.Uploading.label)
        assertEquals("Sprawdzam zapis", PhotoUploadStatus.Verifying.label)
        assertEquals("Nie wysłano, ponów", PhotoUploadStatus.FailedRetryable.label)
        assertEquals("Zdjęcie nie zostało zapisane", PhotoUploadStatus.FailedPermanent.label)
        assertEquals("Zapisane", PhotoUploadStatus.Confirmed.label)
    }
}
