package com.github.nullptroma.wallenc.usecases.fakes

import com.github.nullptroma.wallenc.domain.interfaces.IStorageSyncGroupStore
import com.github.nullptroma.wallenc.domain.interfaces.StorageSyncGroup

class FakeStorageSyncGroupStore(
    private var groups: List<StorageSyncGroup> = emptyList(),
) : IStorageSyncGroupStore {
    override suspend fun getGroups(): List<StorageSyncGroup> = groups

    override suspend fun putGroup(group: StorageSyncGroup) {
        groups = groups.filterNot { it.id == group.id } + group
    }

    override suspend fun removeGroup(groupId: String) {
        groups = groups.filterNot { it.id == groupId }
    }
}
