Add tests for credentials

This commit is contained in:
Shinokuni 2021-10-04 18:35:26 +02:00
parent 5582e3860d
commit beebed751f
1 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,25 @@
package com.readrops.api.services
import com.readrops.api.services.freshrss.FreshRSSCredentials
import com.readrops.api.services.nextcloudnews.NextNewsCredentials
import org.junit.Test
import kotlin.test.assertEquals
class CredentialsTest {
@Test
fun credentialsTest() {
val credentials = FreshRSSCredentials("token", "https://freshrss.org")
assertEquals(credentials.authorization!!, "GoogleLogin auth=token")
assertEquals(credentials.url, "https://freshrss.org")
}
@Test
fun nextcloudNewsCredentialsTest() {
val credentials = NextNewsCredentials("login", "password", "https://freshrss.org")
assertEquals(credentials.authorization!!, "Basic bG9naW46cGFzc3dvcmQ=")
assertEquals(credentials.url, "https://freshrss.org")
}
}