-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
timer.go
48 lines (37 loc) · 1019 Bytes
/
timer.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
// Code generated by mockery v2.38.0. DO NOT EDIT.
package mocks
import (
time "time"
mock "github.com/stretchr/testify/mock"
)
// Timer is an autogenerated mock type for the Timer type
type Timer struct {
mock.Mock
}
// After provides a mock function with given fields: d
func (_m *Timer) After(d time.Duration) <-chan time.Time {
ret := _m.Called(d)
if len(ret) == 0 {
panic("no return value specified for After")
}
var r0 <-chan time.Time
if rf, ok := ret.Get(0).(func(time.Duration) <-chan time.Time); ok {
r0 = rf(d)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan time.Time)
}
}
return r0
}
// NewTimer creates a new instance of Timer. 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 NewTimer(t interface {
mock.TestingT
Cleanup(func())
}) *Timer {
mock := &Timer{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}