25 lines
499 B
Go
25 lines
499 B
Go
package orchestrator
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/vasyansk/imap-copier/internal/store"
|
|
)
|
|
|
|
func TestGateOK(t *testing.T) {
|
|
ok := []store.Account{
|
|
{TestSrcStatus: "ok", TestDstStatus: "ok"},
|
|
{TestSrcStatus: "ok", TestDstStatus: "ok"},
|
|
}
|
|
if !gateOK(ok) {
|
|
t.Fatal("all ok must pass gate")
|
|
}
|
|
bad := []store.Account{{TestSrcStatus: "ok", TestDstStatus: "fail"}}
|
|
if gateOK(bad) {
|
|
t.Fatal("any non-ok must fail gate")
|
|
}
|
|
if gateOK(nil) {
|
|
t.Fatal("empty accounts must fail gate")
|
|
}
|
|
}
|