flamingo.me/flamingo-commerce/v3@v3.11.0/cart/infrastructure/mocks/voucher_handler.go (about)

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