// Code generated by pegomock. DO NOT EDIT. // Source: github.com/derailed/k9s/internal/resource (interfaces: SwitchableCruder) package resource_test import ( k8s "github.com/derailed/k9s/internal/k8s" pegomock "github.com/petergtz/pegomock" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "reflect" "time" ) type MockSwitchableCruder struct { fail func(message string, callerSkip ...int) } func NewMockSwitchableCruder(options ...pegomock.Option) *MockSwitchableCruder { mock := &MockSwitchableCruder{} for _, option := range options { option.Apply(mock) } return mock } func (mock *MockSwitchableCruder) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } func (mock *MockSwitchableCruder) FailHandler() pegomock.FailHandler { return mock.fail } func (mock *MockSwitchableCruder) Delete(_param0 string, _param1 string, _param2 bool, _param3 bool) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSwitchableCruder().") } params := []pegomock.Param{_param0, _param1, _param2, _param3} result := pegomock.GetGenericMockFrom(mock).Invoke("Delete", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) var ret0 error if len(result) != 0 { if result[0] != nil { ret0 = result[0].(error) } } return ret0 } func (mock *MockSwitchableCruder) Get(_param0 string, _param1 string) (interface{}, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSwitchableCruder().") } params := []pegomock.Param{_param0, _param1} result := pegomock.GetGenericMockFrom(mock).Invoke("Get", params, []reflect.Type{reflect.TypeOf((*interface{})(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) var ret0 interface{} var ret1 error if len(result) != 0 { if result[0] != nil { ret0 = result[0].(interface{}) } if result[1] != nil { ret1 = result[1].(error) } } return ret0, ret1 } func (mock *MockSwitchableCruder) List(_param0 string, _param1 v1.ListOptions) (k8s.Collection, error) { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSwitchableCruder().") } params := []pegomock.Param{_param0, _param1} result := pegomock.GetGenericMockFrom(mock).Invoke("List", params, []reflect.Type{reflect.TypeOf((*k8s.Collection)(nil)).Elem(), reflect.TypeOf((*error)(nil)).Elem()}) var ret0 k8s.Collection var ret1 error if len(result) != 0 { if result[0] != nil { ret0 = result[0].(k8s.Collection) } if result[1] != nil { ret1 = result[1].(error) } } return ret0, ret1 } func (mock *MockSwitchableCruder) MustCurrentContextName() string { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSwitchableCruder().") } params := []pegomock.Param{} result := pegomock.GetGenericMockFrom(mock).Invoke("MustCurrentContextName", params, []reflect.Type{reflect.TypeOf((*string)(nil)).Elem()}) var ret0 string if len(result) != 0 { if result[0] != nil { ret0 = result[0].(string) } } return ret0 } func (mock *MockSwitchableCruder) Switch(_param0 string) error { if mock == nil { panic("mock must not be nil. Use myMock := NewMockSwitchableCruder().") } params := []pegomock.Param{_param0} result := pegomock.GetGenericMockFrom(mock).Invoke("Switch", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) var ret0 error if len(result) != 0 { if result[0] != nil { ret0 = result[0].(error) } } return ret0 } func (mock *MockSwitchableCruder) VerifyWasCalledOnce() *VerifierMockSwitchableCruder { return &VerifierMockSwitchableCruder{ mock: mock, invocationCountMatcher: pegomock.Times(1), } } func (mock *MockSwitchableCruder) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockSwitchableCruder { return &VerifierMockSwitchableCruder{ mock: mock, invocationCountMatcher: invocationCountMatcher, } } func (mock *MockSwitchableCruder) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockSwitchableCruder { return &VerifierMockSwitchableCruder{ mock: mock, invocationCountMatcher: invocationCountMatcher, inOrderContext: inOrderContext, } } func (mock *MockSwitchableCruder) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockSwitchableCruder { return &VerifierMockSwitchableCruder{ mock: mock, invocationCountMatcher: invocationCountMatcher, timeout: timeout, } } type VerifierMockSwitchableCruder struct { mock *MockSwitchableCruder invocationCountMatcher pegomock.Matcher inOrderContext *pegomock.InOrderContext timeout time.Duration } func (verifier *VerifierMockSwitchableCruder) Delete(_param0 string, _param1 string, _param2 bool, _param3 bool) *MockSwitchableCruder_Delete_OngoingVerification { params := []pegomock.Param{_param0, _param1, _param2, _param3} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Delete", params, verifier.timeout) return &MockSwitchableCruder_Delete_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } type MockSwitchableCruder_Delete_OngoingVerification struct { mock *MockSwitchableCruder methodInvocations []pegomock.MethodInvocation } func (c *MockSwitchableCruder_Delete_OngoingVerification) GetCapturedArguments() (string, string, bool, bool) { _param0, _param1, _param2, _param3 := c.GetAllCapturedArguments() return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1], _param3[len(_param3)-1] } func (c *MockSwitchableCruder_Delete_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []bool, _param3 []bool) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(c.methodInvocations)) for u, param := range params[0] { _param0[u] = param.(string) } _param1 = make([]string, len(c.methodInvocations)) for u, param := range params[1] { _param1[u] = param.(string) } _param2 = make([]bool, len(c.methodInvocations)) for u, param := range params[2] { _param2[u] = param.(bool) } _param3 = make([]bool, len(c.methodInvocations)) for u, param := range params[3] { _param3[u] = param.(bool) } } return } func (verifier *VerifierMockSwitchableCruder) Get(_param0 string, _param1 string) *MockSwitchableCruder_Get_OngoingVerification { params := []pegomock.Param{_param0, _param1} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Get", params, verifier.timeout) return &MockSwitchableCruder_Get_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } type MockSwitchableCruder_Get_OngoingVerification struct { mock *MockSwitchableCruder methodInvocations []pegomock.MethodInvocation } func (c *MockSwitchableCruder_Get_OngoingVerification) GetCapturedArguments() (string, string) { _param0, _param1 := c.GetAllCapturedArguments() return _param0[len(_param0)-1], _param1[len(_param1)-1] } func (c *MockSwitchableCruder_Get_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(c.methodInvocations)) for u, param := range params[0] { _param0[u] = param.(string) } _param1 = make([]string, len(c.methodInvocations)) for u, param := range params[1] { _param1[u] = param.(string) } } return } func (verifier *VerifierMockSwitchableCruder) List(_param0 string, _param1 v1.ListOptions) *MockSwitchableCruder_List_OngoingVerification { params := []pegomock.Param{_param0, _param1} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "List", params, verifier.timeout) return &MockSwitchableCruder_List_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } type MockSwitchableCruder_List_OngoingVerification struct { mock *MockSwitchableCruder methodInvocations []pegomock.MethodInvocation } func (c *MockSwitchableCruder_List_OngoingVerification) GetCapturedArguments() (string, v1.ListOptions) { _param0, _param1 := c.GetAllCapturedArguments() return _param0[len(_param0)-1], _param1[len(_param1)-1] } func (c *MockSwitchableCruder_List_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []v1.ListOptions) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(c.methodInvocations)) for u, param := range params[0] { _param0[u] = param.(string) } _param1 = make([]v1.ListOptions, len(c.methodInvocations)) for u, param := range params[1] { _param1[u] = param.(v1.ListOptions) } } return } func (verifier *VerifierMockSwitchableCruder) MustCurrentContextName() *MockSwitchableCruder_MustCurrentContextName_OngoingVerification { params := []pegomock.Param{} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "MustCurrentContextName", params, verifier.timeout) return &MockSwitchableCruder_MustCurrentContextName_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } type MockSwitchableCruder_MustCurrentContextName_OngoingVerification struct { mock *MockSwitchableCruder methodInvocations []pegomock.MethodInvocation } func (c *MockSwitchableCruder_MustCurrentContextName_OngoingVerification) GetCapturedArguments() { } func (c *MockSwitchableCruder_MustCurrentContextName_OngoingVerification) GetAllCapturedArguments() { } func (verifier *VerifierMockSwitchableCruder) Switch(_param0 string) *MockSwitchableCruder_Switch_OngoingVerification { params := []pegomock.Param{_param0} methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "Switch", params, verifier.timeout) return &MockSwitchableCruder_Switch_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} } type MockSwitchableCruder_Switch_OngoingVerification struct { mock *MockSwitchableCruder methodInvocations []pegomock.MethodInvocation } func (c *MockSwitchableCruder_Switch_OngoingVerification) GetCapturedArguments() string { _param0 := c.GetAllCapturedArguments() return _param0[len(_param0)-1] } func (c *MockSwitchableCruder_Switch_OngoingVerification) GetAllCapturedArguments() (_param0 []string) { params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) if len(params) > 0 { _param0 = make([]string, len(c.methodInvocations)) for u, param := range params[0] { _param0[u] = param.(string) } } return }