package com.github.nullptroma.wallenc.ui.resources

import com.github.nullptroma.wallenc.domain.errors.WallencException
import com.github.nullptroma.wallenc.ui.R
import org.junit.Assert.assertEquals
import org.junit.Test

class WallencUserNotificationMappingTest {

    @Test
    fun mapsFeatureStorageNotFound() {
        val notification = WallencException.Feature.StorageNotFound().toUserNotification()
        assertEquals(R.string.error_storage_not_found, notification.id)
    }

    @Test
    fun mapsStorageIncorrectKey() {
        val notification = WallencException.Storage.IncorrectKey().toUserNotification()
        assertEquals(R.string.error_incorrect_password, notification.id)
    }

    @Test
    fun mapsUnknown() {
        val notification = WallencException.Unknown(Exception("x")).toUserNotification()
        assertEquals(R.string.error_unknown, notification.id)
    }
}
