github.com/prebid/prebid-server@v0.275.0/stored_requests/backends/empty_fetcher/fetcher_test.go (about)

     1  package empty_fetcher
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  )
     7  
     8  func TestErrorLength(t *testing.T) {
     9  	fetcher := EmptyFetcher{}
    10  
    11  	storedReqs, storedImps, errs := fetcher.FetchRequests(context.Background(), []string{"a", "b"}, []string{"c"})
    12  	if len(storedReqs) != 0 {
    13  		t.Errorf("The empty fetcher should never return stored requests. Got %d", len(storedReqs))
    14  	}
    15  	if len(storedImps) != 0 {
    16  		t.Errorf("The empty fetcher should never return stored imps. Got %d", len(storedImps))
    17  	}
    18  	if len(errs) != 3 {
    19  		t.Errorf("The empty fetcher should return 3 errors. Got %d", len(errs))
    20  	}
    21  }