proxy-pool/internal/domain/workerruntime/contract_external_test.go
youfak 6766097ea7
Some checks are pending
ci / proto (push) Waiting to run
ci / test (ubuntu-latest) (push) Waiting to run
ci / test (windows-latest) (push) Waiting to run
ci / race (push) Waiting to run
ci / integration (push) Waiting to run
feat: report gateway proxy outcomes
2026-07-31 17:36:17 +08:00

25 lines
654 B
Go

package workerruntime_test
import (
"testing"
"time"
"proxy-pool/internal/domain/workerruntime"
"proxy-pool/internal/domain/workerruntime/contracttest"
)
func TestMemoryStoreContract(t *testing.T) {
now := time.Date(2026, 7, 31, 9, 0, 0, 0, time.UTC)
contracttest.Run(t, func(t *testing.T) contracttest.Fixture {
t.Helper()
store, err := workerruntime.NewMemoryStore(func() time.Time { return now })
if err != nil {
t.Fatalf("NewMemoryStore(): %v", err)
}
return contracttest.Fixture{
Store: store, Reader: store, Outcomes: store, TTL: time.Minute,
Advance: func(duration time.Duration) { now = now.Add(duration) },
}
})
}