| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- // Code generated by mockery; DO NOT EDIT.
- // github.com/vektra/mockery
- // template: testify
- package foodgroup
- import (
- "context"
- "github.com/mk6i/open-oscar-server/state"
- mock "github.com/stretchr/testify/mock"
- )
- // newMockSessionRegistry creates a new instance of mockSessionRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
- // The first argument is typically a *testing.T value.
- func newMockSessionRegistry(t interface {
- mock.TestingT
- Cleanup(func())
- }) *mockSessionRegistry {
- mock := &mockSessionRegistry{}
- mock.Mock.Test(t)
- t.Cleanup(func() { mock.AssertExpectations(t) })
- return mock
- }
- // mockSessionRegistry is an autogenerated mock type for the SessionRegistry type
- type mockSessionRegistry struct {
- mock.Mock
- }
- type mockSessionRegistry_Expecter struct {
- mock *mock.Mock
- }
- func (_m *mockSessionRegistry) EXPECT() *mockSessionRegistry_Expecter {
- return &mockSessionRegistry_Expecter{mock: &_m.Mock}
- }
- // AddSession provides a mock function for the type mockSessionRegistry
- func (_mock *mockSessionRegistry) AddSession(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session)) (*state.SessionInstance, error) {
- // func(sess *state.Session)
- _va := make([]interface{}, len(cfg))
- for _i := range cfg {
- _va[_i] = cfg[_i]
- }
- var _ca []interface{}
- _ca = append(_ca, ctx, screenName, doMultiSess)
- _ca = append(_ca, _va...)
- ret := _mock.Called(_ca...)
- if len(ret) == 0 {
- panic("no return value specified for AddSession")
- }
- var r0 *state.SessionInstance
- var r1 error
- if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) (*state.SessionInstance, error)); ok {
- return returnFunc(ctx, screenName, doMultiSess, cfg...)
- }
- if returnFunc, ok := ret.Get(0).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) *state.SessionInstance); ok {
- r0 = returnFunc(ctx, screenName, doMultiSess, cfg...)
- } else {
- if ret.Get(0) != nil {
- r0 = ret.Get(0).(*state.SessionInstance)
- }
- }
- if returnFunc, ok := ret.Get(1).(func(context.Context, state.DisplayScreenName, bool, ...func(sess *state.Session)) error); ok {
- r1 = returnFunc(ctx, screenName, doMultiSess, cfg...)
- } else {
- r1 = ret.Error(1)
- }
- return r0, r1
- }
- // mockSessionRegistry_AddSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddSession'
- type mockSessionRegistry_AddSession_Call struct {
- *mock.Call
- }
- // AddSession is a helper method to define mock.On call
- // - ctx context.Context
- // - screenName state.DisplayScreenName
- // - doMultiSess bool
- // - cfg ...func(sess *state.Session)
- func (_e *mockSessionRegistry_Expecter) AddSession(ctx interface{}, screenName interface{}, doMultiSess interface{}, cfg ...interface{}) *mockSessionRegistry_AddSession_Call {
- return &mockSessionRegistry_AddSession_Call{Call: _e.mock.On("AddSession",
- append([]interface{}{ctx, screenName, doMultiSess}, cfg...)...)}
- }
- func (_c *mockSessionRegistry_AddSession_Call) Run(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session))) *mockSessionRegistry_AddSession_Call {
- _c.Call.Run(func(args mock.Arguments) {
- var arg0 context.Context
- if args[0] != nil {
- arg0 = args[0].(context.Context)
- }
- var arg1 state.DisplayScreenName
- if args[1] != nil {
- arg1 = args[1].(state.DisplayScreenName)
- }
- var arg2 bool
- if args[2] != nil {
- arg2 = args[2].(bool)
- }
- var arg3 []func(sess *state.Session)
- variadicArgs := make([]func(sess *state.Session), len(args)-3)
- for i, a := range args[3:] {
- if a != nil {
- variadicArgs[i] = a.(func(sess *state.Session))
- }
- }
- arg3 = variadicArgs
- run(
- arg0,
- arg1,
- arg2,
- arg3...,
- )
- })
- return _c
- }
- func (_c *mockSessionRegistry_AddSession_Call) Return(sessionInstance *state.SessionInstance, err error) *mockSessionRegistry_AddSession_Call {
- _c.Call.Return(sessionInstance, err)
- return _c
- }
- func (_c *mockSessionRegistry_AddSession_Call) RunAndReturn(run func(ctx context.Context, screenName state.DisplayScreenName, doMultiSess bool, cfg ...func(sess *state.Session)) (*state.SessionInstance, error)) *mockSessionRegistry_AddSession_Call {
- _c.Call.Return(run)
- return _c
- }
- // RemoveSession provides a mock function for the type mockSessionRegistry
- func (_mock *mockSessionRegistry) RemoveSession(session *state.Session) {
- _mock.Called(session)
- return
- }
- // mockSessionRegistry_RemoveSession_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveSession'
- type mockSessionRegistry_RemoveSession_Call struct {
- *mock.Call
- }
- // RemoveSession is a helper method to define mock.On call
- // - session *state.Session
- func (_e *mockSessionRegistry_Expecter) RemoveSession(session interface{}) *mockSessionRegistry_RemoveSession_Call {
- return &mockSessionRegistry_RemoveSession_Call{Call: _e.mock.On("RemoveSession", session)}
- }
- func (_c *mockSessionRegistry_RemoveSession_Call) Run(run func(session *state.Session)) *mockSessionRegistry_RemoveSession_Call {
- _c.Call.Run(func(args mock.Arguments) {
- var arg0 *state.Session
- if args[0] != nil {
- arg0 = args[0].(*state.Session)
- }
- run(
- arg0,
- )
- })
- return _c
- }
- func (_c *mockSessionRegistry_RemoveSession_Call) Return() *mockSessionRegistry_RemoveSession_Call {
- _c.Call.Return()
- return _c
- }
- func (_c *mockSessionRegistry_RemoveSession_Call) RunAndReturn(run func(session *state.Session)) *mockSessionRegistry_RemoveSession_Call {
- _c.Run(run)
- return _c
- }
|