package requester import "testing" // Unservable is judged on a round that excluded nobody: a bidder that declined an accept (full when it did) may take the next round's RFP. func TestUnservableByIgnoresRoundsThatExcludedABidder(t *testing.T) { bidders := []Bidder{{DID: "did:b", Endpoint: "https://b"}} r := &contractRunner{bidderDeclines: map[string]BidderDeclined{"did:b": {DID: "did:b", Kind: declineUnservable, Reason: "no"}}} if got := r.unservableBy(bidders); got == "" { t.Fatal("every bidder asked declined unservable: fail fast") } r.declined = []string{"did:a"} if got := r.unservableBy(bidders); got != "" { t.Fatalf("a bidder declined an accept (it may bid next round), still failing fast: %q", got) } }