mock_session_retriever_test.go 2.7 KB

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