mock_rate_limit_updater_test.go 3.2 KB

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