session_manager_mock.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // Code generated by mockery v2.35.2. DO NOT EDIT.
  2. package handler
  3. import (
  4. state "github.com/mkaminski/goaim/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. // Empty provides a mock function with given fields:
  18. func (_m *mockSessionManager) Empty() bool {
  19. ret := _m.Called()
  20. var r0 bool
  21. if rf, ok := ret.Get(0).(func() bool); ok {
  22. r0 = rf()
  23. } else {
  24. r0 = ret.Get(0).(bool)
  25. }
  26. return r0
  27. }
  28. // mockSessionManager_Empty_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Empty'
  29. type mockSessionManager_Empty_Call struct {
  30. *mock.Call
  31. }
  32. // Empty is a helper method to define mock.On call
  33. func (_e *mockSessionManager_Expecter) Empty() *mockSessionManager_Empty_Call {
  34. return &mockSessionManager_Empty_Call{Call: _e.mock.On("Empty")}
  35. }
  36. func (_c *mockSessionManager_Empty_Call) Run(run func()) *mockSessionManager_Empty_Call {
  37. _c.Call.Run(func(args mock.Arguments) {
  38. run()
  39. })
  40. return _c
  41. }
  42. func (_c *mockSessionManager_Empty_Call) Return(_a0 bool) *mockSessionManager_Empty_Call {
  43. _c.Call.Return(_a0)
  44. return _c
  45. }
  46. func (_c *mockSessionManager_Empty_Call) RunAndReturn(run func() bool) *mockSessionManager_Empty_Call {
  47. _c.Call.Return(run)
  48. return _c
  49. }
  50. // NewSessionWithSN provides a mock function with given fields: sessID, screenName
  51. func (_m *mockSessionManager) NewSessionWithSN(sessID string, screenName string) *state.Session {
  52. ret := _m.Called(sessID, screenName)
  53. var r0 *state.Session
  54. if rf, ok := ret.Get(0).(func(string, string) *state.Session); ok {
  55. r0 = rf(sessID, screenName)
  56. } else {
  57. if ret.Get(0) != nil {
  58. r0 = ret.Get(0).(*state.Session)
  59. }
  60. }
  61. return r0
  62. }
  63. // mockSessionManager_NewSessionWithSN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'NewSessionWithSN'
  64. type mockSessionManager_NewSessionWithSN_Call struct {
  65. *mock.Call
  66. }
  67. // NewSessionWithSN is a helper method to define mock.On call
  68. // - sessID string
  69. // - screenName string
  70. func (_e *mockSessionManager_Expecter) NewSessionWithSN(sessID interface{}, screenName interface{}) *mockSessionManager_NewSessionWithSN_Call {
  71. return &mockSessionManager_NewSessionWithSN_Call{Call: _e.mock.On("NewSessionWithSN", sessID, screenName)}
  72. }
  73. func (_c *mockSessionManager_NewSessionWithSN_Call) Run(run func(sessID string, screenName string)) *mockSessionManager_NewSessionWithSN_Call {
  74. _c.Call.Run(func(args mock.Arguments) {
  75. run(args[0].(string), args[1].(string))
  76. })
  77. return _c
  78. }
  79. func (_c *mockSessionManager_NewSessionWithSN_Call) Return(_a0 *state.Session) *mockSessionManager_NewSessionWithSN_Call {
  80. _c.Call.Return(_a0)
  81. return _c
  82. }
  83. func (_c *mockSessionManager_NewSessionWithSN_Call) RunAndReturn(run func(string, string) *state.Session) *mockSessionManager_NewSessionWithSN_Call {
  84. _c.Call.Return(run)
  85. return _c
  86. }
  87. // Remove provides a mock function with given fields: sess
  88. func (_m *mockSessionManager) Remove(sess *state.Session) {
  89. _m.Called(sess)
  90. }
  91. // mockSessionManager_Remove_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Remove'
  92. type mockSessionManager_Remove_Call struct {
  93. *mock.Call
  94. }
  95. // Remove is a helper method to define mock.On call
  96. // - sess *state.Session
  97. func (_e *mockSessionManager_Expecter) Remove(sess interface{}) *mockSessionManager_Remove_Call {
  98. return &mockSessionManager_Remove_Call{Call: _e.mock.On("Remove", sess)}
  99. }
  100. func (_c *mockSessionManager_Remove_Call) Run(run func(sess *state.Session)) *mockSessionManager_Remove_Call {
  101. _c.Call.Run(func(args mock.Arguments) {
  102. run(args[0].(*state.Session))
  103. })
  104. return _c
  105. }
  106. func (_c *mockSessionManager_Remove_Call) Return() *mockSessionManager_Remove_Call {
  107. _c.Call.Return()
  108. return _c
  109. }
  110. func (_c *mockSessionManager_Remove_Call) RunAndReturn(run func(*state.Session)) *mockSessionManager_Remove_Call {
  111. _c.Call.Return(run)
  112. return _c
  113. }
  114. // Retrieve provides a mock function with given fields: ID
  115. func (_m *mockSessionManager) Retrieve(ID string) (*state.Session, bool) {
  116. ret := _m.Called(ID)
  117. var r0 *state.Session
  118. var r1 bool
  119. if rf, ok := ret.Get(0).(func(string) (*state.Session, bool)); ok {
  120. return rf(ID)
  121. }
  122. if rf, ok := ret.Get(0).(func(string) *state.Session); ok {
  123. r0 = rf(ID)
  124. } else {
  125. if ret.Get(0) != nil {
  126. r0 = ret.Get(0).(*state.Session)
  127. }
  128. }
  129. if rf, ok := ret.Get(1).(func(string) bool); ok {
  130. r1 = rf(ID)
  131. } else {
  132. r1 = ret.Get(1).(bool)
  133. }
  134. return r0, r1
  135. }
  136. // mockSessionManager_Retrieve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Retrieve'
  137. type mockSessionManager_Retrieve_Call struct {
  138. *mock.Call
  139. }
  140. // Retrieve is a helper method to define mock.On call
  141. // - ID string
  142. func (_e *mockSessionManager_Expecter) Retrieve(ID interface{}) *mockSessionManager_Retrieve_Call {
  143. return &mockSessionManager_Retrieve_Call{Call: _e.mock.On("Retrieve", ID)}
  144. }
  145. func (_c *mockSessionManager_Retrieve_Call) Run(run func(ID string)) *mockSessionManager_Retrieve_Call {
  146. _c.Call.Run(func(args mock.Arguments) {
  147. run(args[0].(string))
  148. })
  149. return _c
  150. }
  151. func (_c *mockSessionManager_Retrieve_Call) Return(_a0 *state.Session, _a1 bool) *mockSessionManager_Retrieve_Call {
  152. _c.Call.Return(_a0, _a1)
  153. return _c
  154. }
  155. func (_c *mockSessionManager_Retrieve_Call) RunAndReturn(run func(string) (*state.Session, bool)) *mockSessionManager_Retrieve_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. }