/
mock_q_offers.go
42 lines (33 loc) · 1.07 KB
/
mock_q_offers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package history
import (
"context"
"github.com/stretchr/testify/mock"
)
// MockQOffers is a mock implementation of the QOffers interface
type MockQOffers struct {
mock.Mock
}
func (m *MockQOffers) StreamAllOffers(ctx context.Context, callback func(Offer) error) error {
a := m.Called(ctx, callback)
return a.Error(0)
}
func (m *MockQOffers) GetOffersByIDs(ctx context.Context, ids []int64) ([]Offer, error) {
a := m.Called(ctx, ids)
return a.Get(0).([]Offer), a.Error(1)
}
func (m *MockQOffers) GetUpdatedOffers(ctx context.Context, newerThanSequence uint32) ([]Offer, error) {
a := m.Called(ctx, newerThanSequence)
return a.Get(0).([]Offer), a.Error(1)
}
func (m *MockQOffers) CountOffers(ctx context.Context) (int, error) {
a := m.Called(ctx)
return a.Get(0).(int), a.Error(1)
}
func (m *MockQOffers) UpsertOffers(ctx context.Context, rows []Offer) error {
a := m.Called(ctx, rows)
return a.Error(0)
}
func (m *MockQOffers) CompactOffers(ctx context.Context, cutOffSequence uint32) (int64, error) {
a := m.Called(ctx, cutOffSequence)
return a.Get(0).(int64), a.Error(1)
}