session_manager_mock_test.go 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // Code generated by mockery v2.38.0. DO NOT EDIT.
  2. package handler
  3. import (
  4. state "github.com/mk6i/retro-aim-server/state"
  5. mock "github.com/stretchr/testify/mock"
  6. )
  7. // mockSessionManager is an autogenerated mock type for the SessionManager type
  8. type mockSessionManager struct {
  9. mock.Mock
  10. }
  11. type mockSessionManager_Expecter struct {
  12. mock *mock.Mock
  13. }
  14. func (_m *mockSessionManager) EXPECT() *mockSessionManager_Expecter {
  15. return &mockSessionManager_Expecter{mock: &_m.Mock}
  16. }
  17. // AddSession provides a mock function with given fields: sessID, screenName
  18. func (_m *mockSessionManager) AddSession(sessID string, screenName string) *state.Session {
  19. ret := _m.Called(sessID, screenName)
  20. if len(ret) == 0 {
  21. panic("no return value specified for AddSession")
  22. }
  23. var r0 *state.Session
  24. if rf, ok := ret.Get(0).(func(string, string) *state.Session); ok {
  25. r0 = rf(sessID, screenName)
  26. } else {
  27. if ret.Get(0) != nil {
  28. r0 = ret.Get(0).(*state.Session)
  29. }
  30. }
  31. return r0
  32. }
  33. // mockSessionManager_AddSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSession'
  34. type mockSessionManager_AddSession_Call struct {
  35. *mock.Call
  36. }
  37. // AddSession is a helper method to define mock.On call
  38. // - sessID string
  39. // - screenName string
  40. func (_e *mockSessionManager_Expecter) AddSession(sessID interface{}, screenName interface{}) *mockSessionManager_AddSession_Call {
  41. return &mockSessionManager_AddSession_Call{Call: _e.mock.On("AddSession", sessID, screenName)}
  42. }
  43. func (_c *mockSessionManager_AddSession_Call) Run(run func(sessID string, screenName string)) *mockSessionManager_AddSession_Call {
  44. _c.Call.Run(func(args mock.Arguments) {
  45. run(args[0].(string), args[1].(string))
  46. })
  47. return _c
  48. }
  49. func (_c *mockSessionManager_AddSession_Call) Return(_a0 *state.Session) *mockSessionManager_AddSession_Call {
  50. _c.Call.Return(_a0)
  51. return _c
  52. }
  53. func (_c *mockSessionManager_AddSession_Call) RunAndReturn(run func(string, string) *state.Session) *mockSessionManager_AddSession_Call {
  54. _c.Call.Return(run)
  55. return _c
  56. }
  57. // Empty provides a mock function with given fields:
  58. func (_m *mockSessionManager) Empty() bool {
  59. ret := _m.Called()
  60. if len(ret) == 0 {
  61. panic("no return value specified for Empty")
  62. }
  63. var r0 bool
  64. if rf, ok := ret.Get(0).(func() bool); ok {
  65. r0 = rf()
  66. } else {
  67. r0 = ret.Get(0).(bool)
  68. }
  69. return r0
  70. }
  71. // mockSessionManager_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty'
  72. type mockSessionManager_Empty_Call struct {
  73. *mock.Call
  74. }
  75. // Empty is a helper method to define mock.On call
  76. func (_e *mockSessionManager_Expecter) Empty() *mockSessionManager_Empty_Call {
  77. return &mockSessionManager_Empty_Call{Call: _e.mock.On("Empty")}
  78. }
  79. func (_c *mockSessionManager_Empty_Call) Run(run func()) *mockSessionManager_Empty_Call {
  80. _c.Call.Run(func(args mock.Arguments) {
  81. run()
  82. })
  83. return _c
  84. }
  85. func (_c *mockSessionManager_Empty_Call) Return(_a0 bool) *mockSessionManager_Empty_Call {
  86. _c.Call.Return(_a0)
  87. return _c
  88. }
  89. func (_c *mockSessionManager_Empty_Call) RunAndReturn(run func() bool) *mockSessionManager_Empty_Call {
  90. _c.Call.Return(run)
  91. return _c
  92. }
  93. // RemoveSession provides a mock function with given fields: sess
  94. func (_m *mockSessionManager) RemoveSession(sess *state.Session) {
  95. _m.Called(sess)
  96. }
  97. // mockSessionManager_RemoveSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSession'
  98. type mockSessionManager_RemoveSession_Call struct {
  99. *mock.Call
  100. }
  101. // RemoveSession is a helper method to define mock.On call
  102. // - sess *state.Session
  103. func (_e *mockSessionManager_Expecter) RemoveSession(sess interface{}) *mockSessionManager_RemoveSession_Call {
  104. return &mockSessionManager_RemoveSession_Call{Call: _e.mock.On("RemoveSession", sess)}
  105. }
  106. func (_c *mockSessionManager_RemoveSession_Call) Run(run func(sess *state.Session)) *mockSessionManager_RemoveSession_Call {
  107. _c.Call.Run(func(args mock.Arguments) {
  108. run(args[0].(*state.Session))
  109. })
  110. return _c
  111. }
  112. func (_c *mockSessionManager_RemoveSession_Call) Return() *mockSessionManager_RemoveSession_Call {
  113. _c.Call.Return()
  114. return _c
  115. }
  116. func (_c *mockSessionManager_RemoveSession_Call) RunAndReturn(run func(*state.Session)) *mockSessionManager_RemoveSession_Call {
  117. _c.Call.Return(run)
  118. return _c
  119. }
  120. // RetrieveSession provides a mock function with given fields: ID
  121. func (_m *mockSessionManager) RetrieveSession(ID string) *state.Session {
  122. ret := _m.Called(ID)
  123. if len(ret) == 0 {
  124. panic("no return value specified for RetrieveSession")
  125. }
  126. var r0 *state.Session
  127. if rf, ok := ret.Get(0).(func(string) *state.Session); ok {
  128. r0 = rf(ID)
  129. } else {
  130. if ret.Get(0) != nil {
  131. r0 = ret.Get(0).(*state.Session)
  132. }
  133. }
  134. return r0
  135. }
  136. // mockSessionManager_RetrieveSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RetrieveSession'
  137. type mockSessionManager_RetrieveSession_Call struct {
  138. *mock.Call
  139. }
  140. // RetrieveSession is a helper method to define mock.On call
  141. // - ID string
  142. func (_e *mockSessionManager_Expecter) RetrieveSession(ID interface{}) *mockSessionManager_RetrieveSession_Call {
  143. return &mockSessionManager_RetrieveSession_Call{Call: _e.mock.On("RetrieveSession", ID)}
  144. }
  145. func (_c *mockSessionManager_RetrieveSession_Call) Run(run func(ID string)) *mockSessionManager_RetrieveSession_Call {
  146. _c.Call.Run(func(args mock.Arguments) {
  147. run(args[0].(string))
  148. })
  149. return _c
  150. }
  151. func (_c *mockSessionManager_RetrieveSession_Call) Return(_a0 *state.Session) *mockSessionManager_RetrieveSession_Call {
  152. _c.Call.Return(_a0)
  153. return _c
  154. }
  155. func (_c *mockSessionManager_RetrieveSession_Call) RunAndReturn(run func(string) *state.Session) *mockSessionManager_RetrieveSession_Call {
  156. _c.Call.Return(run)
  157. return _c
  158. }
  159. // newMockSessionManager creates a new instance of mockSessionManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  160. // The first argument is typically a *testing.T value.
  161. func newMockSessionManager(t interface {
  162. mock.TestingT
  163. Cleanup(func())
  164. }) *mockSessionManager {
  165. mock := &mockSessionManager{}
  166. mock.Mock.Test(t)
  167. t.Cleanup(func() { mock.AssertExpectations(t) })
  168. return mock
  169. }