mock_relationship_fetcher_test.go 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package icq_legacy
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. mock "github.com/stretchr/testify/mock"
  9. )
  10. // newMockRelationshipFetcher creates a new instance of mockRelationshipFetcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  11. // The first argument is typically a *testing.T value.
  12. func newMockRelationshipFetcher(t interface {
  13. mock.TestingT
  14. Cleanup(func())
  15. }) *mockRelationshipFetcher {
  16. mock := &mockRelationshipFetcher{}
  17. mock.Mock.Test(t)
  18. t.Cleanup(func() { mock.AssertExpectations(t) })
  19. return mock
  20. }
  21. // mockRelationshipFetcher is an autogenerated mock type for the RelationshipFetcher type
  22. type mockRelationshipFetcher struct {
  23. mock.Mock
  24. }
  25. type mockRelationshipFetcher_Expecter struct {
  26. mock *mock.Mock
  27. }
  28. func (_m *mockRelationshipFetcher) EXPECT() *mockRelationshipFetcher_Expecter {
  29. return &mockRelationshipFetcher_Expecter{mock: &_m.Mock}
  30. }
  31. // AllRelationships provides a mock function for the type mockRelationshipFetcher
  32. func (_mock *mockRelationshipFetcher) AllRelationships(ctx context.Context, me state.IdentScreenName, filter []state.IdentScreenName) ([]state.Relationship, error) {
  33. ret := _mock.Called(ctx, me, filter)
  34. if len(ret) == 0 {
  35. panic("no return value specified for AllRelationships")
  36. }
  37. var r0 []state.Relationship
  38. var r1 error
  39. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, []state.IdentScreenName) ([]state.Relationship, error)); ok {
  40. return returnFunc(ctx, me, filter)
  41. }
  42. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, []state.IdentScreenName) []state.Relationship); ok {
  43. r0 = returnFunc(ctx, me, filter)
  44. } else {
  45. if ret.Get(0) != nil {
  46. r0 = ret.Get(0).([]state.Relationship)
  47. }
  48. }
  49. if returnFunc, ok := ret.Get(1).(func(context.Context, state.IdentScreenName, []state.IdentScreenName) error); ok {
  50. r1 = returnFunc(ctx, me, filter)
  51. } else {
  52. r1 = ret.Error(1)
  53. }
  54. return r0, r1
  55. }
  56. // mockRelationshipFetcher_AllRelationships_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AllRelationships'
  57. type mockRelationshipFetcher_AllRelationships_Call struct {
  58. *mock.Call
  59. }
  60. // AllRelationships is a helper method to define mock.On call
  61. // - ctx context.Context
  62. // - me state.IdentScreenName
  63. // - filter []state.IdentScreenName
  64. func (_e *mockRelationshipFetcher_Expecter) AllRelationships(ctx interface{}, me interface{}, filter interface{}) *mockRelationshipFetcher_AllRelationships_Call {
  65. return &mockRelationshipFetcher_AllRelationships_Call{Call: _e.mock.On("AllRelationships", ctx, me, filter)}
  66. }
  67. func (_c *mockRelationshipFetcher_AllRelationships_Call) Run(run func(ctx context.Context, me state.IdentScreenName, filter []state.IdentScreenName)) *mockRelationshipFetcher_AllRelationships_Call {
  68. _c.Call.Run(func(args mock.Arguments) {
  69. var arg0 context.Context
  70. if args[0] != nil {
  71. arg0 = args[0].(context.Context)
  72. }
  73. var arg1 state.IdentScreenName
  74. if args[1] != nil {
  75. arg1 = args[1].(state.IdentScreenName)
  76. }
  77. var arg2 []state.IdentScreenName
  78. if args[2] != nil {
  79. arg2 = args[2].([]state.IdentScreenName)
  80. }
  81. run(
  82. arg0,
  83. arg1,
  84. arg2,
  85. )
  86. })
  87. return _c
  88. }
  89. func (_c *mockRelationshipFetcher_AllRelationships_Call) Return(relationships []state.Relationship, err error) *mockRelationshipFetcher_AllRelationships_Call {
  90. _c.Call.Return(relationships, err)
  91. return _c
  92. }
  93. func (_c *mockRelationshipFetcher_AllRelationships_Call) RunAndReturn(run func(ctx context.Context, me state.IdentScreenName, filter []state.IdentScreenName) ([]state.Relationship, error)) *mockRelationshipFetcher_AllRelationships_Call {
  94. _c.Call.Return(run)
  95. return _c
  96. }
  97. // Relationship provides a mock function for the type mockRelationshipFetcher
  98. func (_mock *mockRelationshipFetcher) Relationship(ctx context.Context, me state.IdentScreenName, them state.IdentScreenName) (state.Relationship, error) {
  99. ret := _mock.Called(ctx, me, them)
  100. if len(ret) == 0 {
  101. panic("no return value specified for Relationship")
  102. }
  103. var r0 state.Relationship
  104. var r1 error
  105. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, state.IdentScreenName) (state.Relationship, error)); ok {
  106. return returnFunc(ctx, me, them)
  107. }
  108. if returnFunc, ok := ret.Get(0).(func(context.Context, state.IdentScreenName, state.IdentScreenName) state.Relationship); ok {
  109. r0 = returnFunc(ctx, me, them)
  110. } else {
  111. r0 = ret.Get(0).(state.Relationship)
  112. }
  113. if returnFunc, ok := ret.Get(1).(func(context.Context, state.IdentScreenName, state.IdentScreenName) error); ok {
  114. r1 = returnFunc(ctx, me, them)
  115. } else {
  116. r1 = ret.Error(1)
  117. }
  118. return r0, r1
  119. }
  120. // mockRelationshipFetcher_Relationship_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Relationship'
  121. type mockRelationshipFetcher_Relationship_Call struct {
  122. *mock.Call
  123. }
  124. // Relationship is a helper method to define mock.On call
  125. // - ctx context.Context
  126. // - me state.IdentScreenName
  127. // - them state.IdentScreenName
  128. func (_e *mockRelationshipFetcher_Expecter) Relationship(ctx interface{}, me interface{}, them interface{}) *mockRelationshipFetcher_Relationship_Call {
  129. return &mockRelationshipFetcher_Relationship_Call{Call: _e.mock.On("Relationship", ctx, me, them)}
  130. }
  131. func (_c *mockRelationshipFetcher_Relationship_Call) Run(run func(ctx context.Context, me state.IdentScreenName, them state.IdentScreenName)) *mockRelationshipFetcher_Relationship_Call {
  132. _c.Call.Run(func(args mock.Arguments) {
  133. var arg0 context.Context
  134. if args[0] != nil {
  135. arg0 = args[0].(context.Context)
  136. }
  137. var arg1 state.IdentScreenName
  138. if args[1] != nil {
  139. arg1 = args[1].(state.IdentScreenName)
  140. }
  141. var arg2 state.IdentScreenName
  142. if args[2] != nil {
  143. arg2 = args[2].(state.IdentScreenName)
  144. }
  145. run(
  146. arg0,
  147. arg1,
  148. arg2,
  149. )
  150. })
  151. return _c
  152. }
  153. func (_c *mockRelationshipFetcher_Relationship_Call) Return(relationship state.Relationship, err error) *mockRelationshipFetcher_Relationship_Call {
  154. _c.Call.Return(relationship, err)
  155. return _c
  156. }
  157. func (_c *mockRelationshipFetcher_Relationship_Call) RunAndReturn(run func(ctx context.Context, me state.IdentScreenName, them state.IdentScreenName) (state.Relationship, error)) *mockRelationshipFetcher_Relationship_Call {
  158. _c.Call.Return(run)
  159. return _c
  160. }