-
Notifications
You must be signed in to change notification settings - Fork 141
/
Copy pathhw_mock.go
94 lines (80 loc) · 3.13 KB
/
hw_mock.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Code generated by MockGen. DO NOT EDIT.
// Source: ./helloworld/helloworld.pb.go
// Package mock_helloworld is a generated GoMock package.
package mock_helloworld
import (
gomock "github.com/golang/mock/gomock"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
reflect "reflect"
helloworld "ultimate-go/awesome-go/grpc-go-mock/helloworld"
)
// MockGreeterClient is a mock of GreeterClient interface
type MockGreeterClient struct {
ctrl *gomock.Controller
recorder *MockGreeterClientMockRecorder
}
// MockGreeterClientMockRecorder is the mock recorder for MockGreeterClient
type MockGreeterClientMockRecorder struct {
mock *MockGreeterClient
}
// NewMockGreeterClient creates a new mock instance
func NewMockGreeterClient(ctrl *gomock.Controller) *MockGreeterClient {
mock := &MockGreeterClient{ctrl: ctrl}
mock.recorder = &MockGreeterClientMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockGreeterClient) EXPECT() *MockGreeterClientMockRecorder {
return m.recorder
}
// SayHello mocks base method
func (m *MockGreeterClient) SayHello(ctx context.Context, in *helloworld.HelloRequest, opts ...grpc.CallOption) (*helloworld.HelloReply, error) {
m.ctrl.T.Helper()
varargs := []interface{}{ctx, in}
for _, a := range opts {
varargs = append(varargs, a)
}
ret := m.ctrl.Call(m, "SayHello", varargs...)
ret0, _ := ret[0].(*helloworld.HelloReply)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SayHello indicates an expected call of SayHello
func (mr *MockGreeterClientMockRecorder) SayHello(ctx, in interface{}, opts ...interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
varargs := append([]interface{}{ctx, in}, opts...)
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SayHello", reflect.TypeOf((*MockGreeterClient)(nil).SayHello), varargs...)
}
// MockGreeterServer is a mock of GreeterServer interface
type MockGreeterServer struct {
ctrl *gomock.Controller
recorder *MockGreeterServerMockRecorder
}
// MockGreeterServerMockRecorder is the mock recorder for MockGreeterServer
type MockGreeterServerMockRecorder struct {
mock *MockGreeterServer
}
// NewMockGreeterServer creates a new mock instance
func NewMockGreeterServer(ctrl *gomock.Controller) *MockGreeterServer {
mock := &MockGreeterServer{ctrl: ctrl}
mock.recorder = &MockGreeterServerMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockGreeterServer) EXPECT() *MockGreeterServerMockRecorder {
return m.recorder
}
// SayHello mocks base method
func (m *MockGreeterServer) SayHello(arg0 context.Context, arg1 *helloworld.HelloRequest) (*helloworld.HelloReply, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "SayHello", arg0, arg1)
ret0, _ := ret[0].(*helloworld.HelloReply)
ret1, _ := ret[1].(error)
return ret0, ret1
}
// SayHello indicates an expected call of SayHello
func (mr *MockGreeterServerMockRecorder) SayHello(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SayHello", reflect.TypeOf((*MockGreeterServer)(nil).SayHello), arg0, arg1)
}