mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
28 lines
817 B
Go
28 lines
817 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestAssignmentProviderFromStorePreservesPlayerScopedRecoveryBoundary(t *testing.T) {
|
|
provider := AssignmentProviderFromStore(nil)
|
|
if provider == nil {
|
|
t.Fatal("store provider was not created")
|
|
}
|
|
if _, err := provider(context.Background(), "player-1", "match-1", time.Unix(1000, 0)); err == nil {
|
|
t.Fatal("nil store was treated as an available assignment source")
|
|
}
|
|
}
|
|
|
|
func TestProposalProviderFromStoreFailsClosedWithoutDatabase(t *testing.T) {
|
|
provider := ProposalProviderFromStore(nil)
|
|
if provider == nil {
|
|
t.Fatal("proposal store provider was not created")
|
|
}
|
|
if _, err := provider.Get(context.Background(), "player-1", "proposal-1", time.Unix(1000, 0)); err == nil {
|
|
t.Fatal("nil store was treated as an available proposal source")
|
|
}
|
|
}
|