Cleanup tests.

This commit is contained in:
Benoit Marty 2025-09-01 15:03:41 +02:00
parent 75a640b986
commit 025131841b
9 changed files with 64 additions and 58 deletions

View file

@ -23,11 +23,12 @@ import org.junit.Test
class RustClientSessionDelegateTest {
@Test
fun `saveSessionInKeychain should update the store`() = runTest {
val sessionStore = InMemorySessionStore()
sessionStore.storeData(
aSessionData(
accessToken = "anAccessToken",
refreshToken = "aRefreshToken",
val sessionStore = InMemorySessionStore(
initialList = listOf(
aSessionData(
accessToken = "anAccessToken",
refreshToken = "aRefreshToken",
)
)
)
val sut = aRustClientSessionDelegate(sessionStore)

View file

@ -24,14 +24,15 @@ class SessionPathsProviderTest {
@Test
fun `if session is found, provides returns the data`() = runTest {
val store = InMemorySessionStore()
val sut = SessionPathsProvider(store)
store.storeData(
aSessionData(
sessionPath = "/a/path/to/a/session",
cachePath = "/a/path/to/a/cache",
val store = InMemorySessionStore(
initialList = listOf(
aSessionData(
sessionPath = "/a/path/to/a/session",
cachePath = "/a/path/to/a/cache",
)
)
)
val sut = SessionPathsProvider(store)
val result = sut.provides(A_SESSION_ID)!!
assertThat(result.fileDirectory.absolutePath).isEqualTo("/a/path/to/a/session")
assertThat(result.cacheDirectory.absolutePath).isEqualTo("/a/path/to/a/cache")