proxy-pool/internal/domain/workerruntime/contract_external_test.go
youfak a79d030c82
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: add worker session runtime domain store
2026-07-31 10:57:39 +08:00

25 lines
619 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,
Advance: func(duration time.Duration) { now = now.Add(duration) },
}
})
}