mock_admin_service_test.go 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Code generated by mockery; DO NOT EDIT.
  2. // github.com/vektra/mockery
  3. // template: testify
  4. package toc
  5. import (
  6. "context"
  7. "github.com/mk6i/open-oscar-server/state"
  8. "github.com/mk6i/open-oscar-server/wire"
  9. mock "github.com/stretchr/testify/mock"
  10. )
  11. // newMockAdminService creates a new instance of mockAdminService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
  12. // The first argument is typically a *testing.T value.
  13. func newMockAdminService(t interface {
  14. mock.TestingT
  15. Cleanup(func())
  16. }) *mockAdminService {
  17. if helper, ok := t.(interface{ Helper() }); ok {
  18. helper.Helper()
  19. }
  20. mock := &mockAdminService{}
  21. mock.Mock.Test(t)
  22. t.Cleanup(func() {
  23. if helper, ok := t.(interface{ Helper() }); ok {
  24. helper.Helper()
  25. }
  26. mock.AssertExpectations(t)
  27. })
  28. return mock
  29. }
  30. // mockAdminService is an autogenerated mock type for the AdminService type
  31. type mockAdminService struct {
  32. mock.Mock
  33. }
  34. type mockAdminService_Expecter struct {
  35. mock *mock.Mock
  36. }
  37. func (_m *mockAdminService) EXPECT() *mockAdminService_Expecter {
  38. return &mockAdminService_Expecter{mock: &_m.Mock}
  39. }
  40. // InfoChangeRequest provides a mock function for the type mockAdminService
  41. func (_mock *mockAdminService) InfoChangeRequest(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error) {
  42. ret := _mock.Called(ctx, instance, inFrame, inBody)
  43. if len(ret) == 0 {
  44. panic("no return value specified for InfoChangeRequest")
  45. }
  46. var r0 wire.SNACMessage
  47. var r1 error
  48. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error)); ok {
  49. return returnFunc(ctx, instance, inFrame, inBody)
  50. }
  51. if returnFunc, ok := ret.Get(0).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) wire.SNACMessage); ok {
  52. r0 = returnFunc(ctx, instance, inFrame, inBody)
  53. } else {
  54. r0 = ret.Get(0).(wire.SNACMessage)
  55. }
  56. if returnFunc, ok := ret.Get(1).(func(context.Context, *state.SessionInstance, wire.SNACFrame, wire.SNAC_0x07_0x04_AdminInfoChangeRequest) error); ok {
  57. r1 = returnFunc(ctx, instance, inFrame, inBody)
  58. } else {
  59. r1 = ret.Error(1)
  60. }
  61. return r0, r1
  62. }
  63. // mockAdminService_InfoChangeRequest_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InfoChangeRequest'
  64. type mockAdminService_InfoChangeRequest_Call struct {
  65. *mock.Call
  66. }
  67. // InfoChangeRequest is a helper method to define mock.On call
  68. // - ctx context.Context
  69. // - instance *state.SessionInstance
  70. // - inFrame wire.SNACFrame
  71. // - inBody wire.SNAC_0x07_0x04_AdminInfoChangeRequest
  72. func (_e *mockAdminService_Expecter) InfoChangeRequest(ctx any, instance any, inFrame any, inBody any) *mockAdminService_InfoChangeRequest_Call {
  73. return &mockAdminService_InfoChangeRequest_Call{Call: _e.mock.On("InfoChangeRequest", ctx, instance, inFrame, inBody)}
  74. }
  75. func (_c *mockAdminService_InfoChangeRequest_Call) Run(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x07_0x04_AdminInfoChangeRequest)) *mockAdminService_InfoChangeRequest_Call {
  76. _c.Call.Run(func(args mock.Arguments) {
  77. var arg0 context.Context
  78. if args[0] != nil {
  79. arg0 = args[0].(context.Context)
  80. }
  81. var arg1 *state.SessionInstance
  82. if args[1] != nil {
  83. arg1 = args[1].(*state.SessionInstance)
  84. }
  85. var arg2 wire.SNACFrame
  86. if args[2] != nil {
  87. arg2 = args[2].(wire.SNACFrame)
  88. }
  89. var arg3 wire.SNAC_0x07_0x04_AdminInfoChangeRequest
  90. if args[3] != nil {
  91. arg3 = args[3].(wire.SNAC_0x07_0x04_AdminInfoChangeRequest)
  92. }
  93. run(
  94. arg0,
  95. arg1,
  96. arg2,
  97. arg3,
  98. )
  99. })
  100. return _c
  101. }
  102. func (_c *mockAdminService_InfoChangeRequest_Call) Return(sNACMessage wire.SNACMessage, err error) *mockAdminService_InfoChangeRequest_Call {
  103. _c.Call.Return(sNACMessage, err)
  104. return _c
  105. }
  106. func (_c *mockAdminService_InfoChangeRequest_Call) RunAndReturn(run func(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error)) *mockAdminService_InfoChangeRequest_Call {
  107. _c.Call.Return(run)
  108. return _c
  109. }