import com.correx.core.events.types.SessionId
import com.correx.core.sessions.DefaultSessionReducer
import com.correx.core.sessions.SessionProjector
import com.correx.core.sessions.SessionStatus
import com.correx.core.sessions.projections.replay.DefaultEventReplayer
import com.correx.infrastructure.persistence.InMemoryEventStore
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

class SessionEmptyReplayTest {

    @Test
    fun `empty session returns initial state`() {
        val store = InMemoryEventStore()
        val replayer = DefaultEventReplayer(
            store,
            SessionProjector(DefaultSessionReducer())
        )

        val state = replayer.rebuild(SessionId("missing"))

        assertEquals(SessionStatus.CREATED, state.status)
    }
}
