package catawiki

import (
	"context"
	"reflect"
	"testing"

	catalog "git.vdhsn.com/barretthousen/barretthousen/src/catalog/api"
)

func TestGetUpcomingAuctions(t *testing.T) {
	type args struct {
		limit int
		page  int
	}
	tests := []struct {
		name        string
		args        args
		wantResults []catalog.Auction
		wantErr     bool
	}{
		{
			name: "1 Page, 25 Results",
			args: args{
				limit: 25,
				page:  1,
			},
			wantResults: make([]catalog.Auction, 25),
			wantErr:     false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			gotResults, err := GetUpcomingAuctions(context.TODO(), tt.args.limit, tt.args.page)
			if (err != nil) != tt.wantErr {
				t.Errorf("GetUpcomingAuctions() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if !reflect.DeepEqual(gotResults, tt.wantResults) {
				t.Errorf("GetUpcomingAuctions() = %v, want %v", gotResults, tt.wantResults)
			}
		})
	}
}
