/
P2PGameFactory.go
160 lines (128 loc) · 4.31 KB
/
P2PGameFactory.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Code generated by mockery v2.15.0. DO NOT EDIT.
package mocks
import (
context "context"
pkg "github.com/complynx/rpssl4bu/backend/pkg"
mock "github.com/stretchr/testify/mock"
types "github.com/complynx/rpssl4bu/backend/pkg/types"
)
// P2PGameFactory is an autogenerated mock type for the P2PGameFactory type
type P2PGameFactory struct {
mock.Mock
}
type P2PGameFactory_Expecter struct {
mock *mock.Mock
}
func (_m *P2PGameFactory) EXPECT() *P2PGameFactory_Expecter {
return &P2PGameFactory_Expecter{mock: &_m.Mock}
}
// CreateGame provides a mock function with given fields: ctx
func (_m *P2PGameFactory) CreateGame(ctx context.Context) (pkg.P2PGame, error) {
ret := _m.Called(ctx)
var r0 pkg.P2PGame
if rf, ok := ret.Get(0).(func(context.Context) pkg.P2PGame); ok {
r0 = rf(ctx)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pkg.P2PGame)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context) error); ok {
r1 = rf(ctx)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// P2PGameFactory_CreateGame_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGame'
type P2PGameFactory_CreateGame_Call struct {
*mock.Call
}
// CreateGame is a helper method to define mock.On call
// - ctx context.Context
func (_e *P2PGameFactory_Expecter) CreateGame(ctx interface{}) *P2PGameFactory_CreateGame_Call {
return &P2PGameFactory_CreateGame_Call{Call: _e.mock.On("CreateGame", ctx)}
}
func (_c *P2PGameFactory_CreateGame_Call) Run(run func(ctx context.Context)) *P2PGameFactory_CreateGame_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *P2PGameFactory_CreateGame_Call) Return(_a0 pkg.P2PGame, _a1 error) *P2PGameFactory_CreateGame_Call {
_c.Call.Return(_a0, _a1)
return _c
}
// GetGame provides a mock function with given fields: id
func (_m *P2PGameFactory) GetGame(id types.GameID) (pkg.P2PGame, bool) {
ret := _m.Called(id)
var r0 pkg.P2PGame
if rf, ok := ret.Get(0).(func(types.GameID) pkg.P2PGame); ok {
r0 = rf(id)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(pkg.P2PGame)
}
}
var r1 bool
if rf, ok := ret.Get(1).(func(types.GameID) bool); ok {
r1 = rf(id)
} else {
r1 = ret.Get(1).(bool)
}
return r0, r1
}
// P2PGameFactory_GetGame_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGame'
type P2PGameFactory_GetGame_Call struct {
*mock.Call
}
// GetGame is a helper method to define mock.On call
// - id types.GameID
func (_e *P2PGameFactory_Expecter) GetGame(id interface{}) *P2PGameFactory_GetGame_Call {
return &P2PGameFactory_GetGame_Call{Call: _e.mock.On("GetGame", id)}
}
func (_c *P2PGameFactory_GetGame_Call) Run(run func(id types.GameID)) *P2PGameFactory_GetGame_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(types.GameID))
})
return _c
}
func (_c *P2PGameFactory_GetGame_Call) Return(_a0 pkg.P2PGame, _a1 bool) *P2PGameFactory_GetGame_Call {
_c.Call.Return(_a0, _a1)
return _c
}
// StopGames provides a mock function with given fields: ctx
func (_m *P2PGameFactory) StopGames(ctx context.Context) {
_m.Called(ctx)
}
// P2PGameFactory_StopGames_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StopGames'
type P2PGameFactory_StopGames_Call struct {
*mock.Call
}
// StopGames is a helper method to define mock.On call
// - ctx context.Context
func (_e *P2PGameFactory_Expecter) StopGames(ctx interface{}) *P2PGameFactory_StopGames_Call {
return &P2PGameFactory_StopGames_Call{Call: _e.mock.On("StopGames", ctx)}
}
func (_c *P2PGameFactory_StopGames_Call) Run(run func(ctx context.Context)) *P2PGameFactory_StopGames_Call {
_c.Call.Run(func(args mock.Arguments) {
run(args[0].(context.Context))
})
return _c
}
func (_c *P2PGameFactory_StopGames_Call) Return() *P2PGameFactory_StopGames_Call {
_c.Call.Return()
return _c
}
type mockConstructorTestingTNewP2PGameFactory interface {
mock.TestingT
Cleanup(func())
}
// NewP2PGameFactory creates a new instance of P2PGameFactory. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewP2PGameFactory(t mockConstructorTestingTNewP2PGameFactory) *P2PGameFactory {
mock := &P2PGameFactory{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}