Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
32 lines
711 B
Go
32 lines
711 B
Go
package server
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"git.breakpilot.com/platform/tenant-registry/internal/store"
|
|
)
|
|
|
|
func TestOverdueStep(t *testing.T) {
|
|
s := &Server{}
|
|
for _, c := range []struct {
|
|
status string
|
|
days int
|
|
next string
|
|
ok bool
|
|
}{
|
|
{"active", 1, "warning", true},
|
|
{"trial", 1, "warning", true},
|
|
{"active", 14, "restricted", true},
|
|
{"warning", 30, "halted", true},
|
|
{"warning", 2, "", false},
|
|
{"restricted", 5, "", false},
|
|
{"demo", 40, "", false},
|
|
{"halted", 40, "", false},
|
|
} {
|
|
next, ok := s.overdueStep(&store.Tenant{Status: c.status}, c.days)
|
|
if next != c.next || ok != c.ok {
|
|
t.Errorf("%s %d days: %q %v, want %q %v", c.status, c.days, next, ok, c.next, c.ok)
|
|
}
|
|
}
|
|
}
|