-
Notifications
You must be signed in to change notification settings - Fork 13
/
hasher.go
74 lines (58 loc) · 1.76 KB
/
hasher.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Code generated by mockery v2.32.4. DO NOT EDIT.
package hash
import mock "github.com/stretchr/testify/mock"
// Hasher is an autogenerated mock type for the Hasher type
type Hasher struct {
mock.Mock
}
type Hasher_Expecter struct {
mock *mock.Mock
}
func (_m *Hasher) EXPECT() *Hasher_Expecter {
return &Hasher_Expecter{mock: &_m.Mock}
}
// HashCode provides a mock function with given fields: key
func (_m *Hasher) HashCode(key []byte) uint64 {
ret := _m.Called(key)
var r0 uint64
if rf, ok := ret.Get(0).(func([]byte) uint64); ok {
r0 = rf(key)
} else {
r0 = ret.Get(0).(uint64)
}
return r0
}
// Hasher_HashCode_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashCode'
type Hasher_HashCode_Call struct {
*mock.Call
}
// HashCode is a helper method to define mock.On call
// - key []byte
func (_e *Hasher_Expecter) HashCode(key interface{}) *Hasher_HashCode_Call {
return &Hasher_HashCode_Call{Call: _e.mock.On("HashCode", key)}
}
func (_c *Hasher_HashCode_Call) Run(run func(key []byte)) *Hasher_HashCode_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].([]byte))
})
return _c
}
func (_c *Hasher_HashCode_Call) Return(_a0 uint64) *Hasher_HashCode_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Hasher_HashCode_Call) RunAndReturn(run func([]byte) uint64) *Hasher_HashCode_Call {
_c.Call.Return(run)
return _c
}
// NewHasher creates a new instance of Hasher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewHasher(t interface {
mock.TestingT
Cleanup(func())
}) *Hasher {
mock := &Hasher{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}