github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/reportingtools/mocks/xunitclient.go (about) 1 // Code generated by pegomock. DO NOT EDIT. 2 // Source: github.com/olli-ai/jx/v2/pkg/reportingtools (interfaces: XUnitClient) 3 4 package reportingtools_test 5 6 import ( 7 "reflect" 8 "time" 9 10 opts "github.com/olli-ai/jx/v2/pkg/cmd/opts" 11 pegomock "github.com/petergtz/pegomock" 12 ) 13 14 type MockXUnitClient struct { 15 fail func(message string, callerSkip ...int) 16 } 17 18 func NewMockXUnitClient(options ...pegomock.Option) *MockXUnitClient { 19 mock := &MockXUnitClient{} 20 for _, option := range options { 21 option.Apply(mock) 22 } 23 return mock 24 } 25 26 func (mock *MockXUnitClient) SetFailHandler(fh pegomock.FailHandler) { mock.fail = fh } 27 func (mock *MockXUnitClient) FailHandler() pegomock.FailHandler { return mock.fail } 28 29 func (mock *MockXUnitClient) CreateHTMLReport(_param0 string, _param1 string, _param2 string) error { 30 if mock == nil { 31 panic("mock must not be nil. Use myMock := NewMockXUnitClient().") 32 } 33 params := []pegomock.Param{_param0, _param1, _param2} 34 result := pegomock.GetGenericMockFrom(mock).Invoke("CreateHTMLReport", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) 35 var ret0 error 36 if len(result) != 0 { 37 if result[0] != nil { 38 ret0 = result[0].(error) 39 } 40 } 41 return ret0 42 } 43 44 func (mock *MockXUnitClient) EnsureNPMIsInstalled() error { 45 if mock == nil { 46 panic("mock must not be nil. Use myMock := NewMockXUnitClient().") 47 } 48 params := []pegomock.Param{} 49 result := pegomock.GetGenericMockFrom(mock).Invoke("EnsureNPMIsInstalled", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) 50 var ret0 error 51 if len(result) != 0 { 52 if result[0] != nil { 53 ret0 = result[0].(error) 54 } 55 } 56 return ret0 57 } 58 59 func (mock *MockXUnitClient) EnsureXUnitViewer(_param0 *opts.CommonOptions) error { 60 if mock == nil { 61 panic("mock must not be nil. Use myMock := NewMockXUnitClient().") 62 } 63 params := []pegomock.Param{_param0} 64 result := pegomock.GetGenericMockFrom(mock).Invoke("EnsureXUnitViewer", params, []reflect.Type{reflect.TypeOf((*error)(nil)).Elem()}) 65 var ret0 error 66 if len(result) != 0 { 67 if result[0] != nil { 68 ret0 = result[0].(error) 69 } 70 } 71 return ret0 72 } 73 74 func (mock *MockXUnitClient) VerifyWasCalledOnce() *VerifierMockXUnitClient { 75 return &VerifierMockXUnitClient{ 76 mock: mock, 77 invocationCountMatcher: pegomock.Times(1), 78 } 79 } 80 81 func (mock *MockXUnitClient) VerifyWasCalled(invocationCountMatcher pegomock.Matcher) *VerifierMockXUnitClient { 82 return &VerifierMockXUnitClient{ 83 mock: mock, 84 invocationCountMatcher: invocationCountMatcher, 85 } 86 } 87 88 func (mock *MockXUnitClient) VerifyWasCalledInOrder(invocationCountMatcher pegomock.Matcher, inOrderContext *pegomock.InOrderContext) *VerifierMockXUnitClient { 89 return &VerifierMockXUnitClient{ 90 mock: mock, 91 invocationCountMatcher: invocationCountMatcher, 92 inOrderContext: inOrderContext, 93 } 94 } 95 96 func (mock *MockXUnitClient) VerifyWasCalledEventually(invocationCountMatcher pegomock.Matcher, timeout time.Duration) *VerifierMockXUnitClient { 97 return &VerifierMockXUnitClient{ 98 mock: mock, 99 invocationCountMatcher: invocationCountMatcher, 100 timeout: timeout, 101 } 102 } 103 104 type VerifierMockXUnitClient struct { 105 mock *MockXUnitClient 106 invocationCountMatcher pegomock.Matcher 107 inOrderContext *pegomock.InOrderContext 108 timeout time.Duration 109 } 110 111 func (verifier *VerifierMockXUnitClient) CreateHTMLReport(_param0 string, _param1 string, _param2 string) *MockXUnitClient_CreateHTMLReport_OngoingVerification { 112 params := []pegomock.Param{_param0, _param1, _param2} 113 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "CreateHTMLReport", params, verifier.timeout) 114 return &MockXUnitClient_CreateHTMLReport_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 115 } 116 117 type MockXUnitClient_CreateHTMLReport_OngoingVerification struct { 118 mock *MockXUnitClient 119 methodInvocations []pegomock.MethodInvocation 120 } 121 122 func (c *MockXUnitClient_CreateHTMLReport_OngoingVerification) GetCapturedArguments() (string, string, string) { 123 _param0, _param1, _param2 := c.GetAllCapturedArguments() 124 return _param0[len(_param0)-1], _param1[len(_param1)-1], _param2[len(_param2)-1] 125 } 126 127 func (c *MockXUnitClient_CreateHTMLReport_OngoingVerification) GetAllCapturedArguments() (_param0 []string, _param1 []string, _param2 []string) { 128 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 129 if len(params) > 0 { 130 _param0 = make([]string, len(c.methodInvocations)) 131 for u, param := range params[0] { 132 _param0[u] = param.(string) 133 } 134 _param1 = make([]string, len(c.methodInvocations)) 135 for u, param := range params[1] { 136 _param1[u] = param.(string) 137 } 138 _param2 = make([]string, len(c.methodInvocations)) 139 for u, param := range params[2] { 140 _param2[u] = param.(string) 141 } 142 } 143 return 144 } 145 146 func (verifier *VerifierMockXUnitClient) EnsureNPMIsInstalled() *MockXUnitClient_EnsureNPMIsInstalled_OngoingVerification { 147 params := []pegomock.Param{} 148 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EnsureNPMIsInstalled", params, verifier.timeout) 149 return &MockXUnitClient_EnsureNPMIsInstalled_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 150 } 151 152 type MockXUnitClient_EnsureNPMIsInstalled_OngoingVerification struct { 153 mock *MockXUnitClient 154 methodInvocations []pegomock.MethodInvocation 155 } 156 157 func (c *MockXUnitClient_EnsureNPMIsInstalled_OngoingVerification) GetCapturedArguments() { 158 } 159 160 func (c *MockXUnitClient_EnsureNPMIsInstalled_OngoingVerification) GetAllCapturedArguments() { 161 } 162 163 func (verifier *VerifierMockXUnitClient) EnsureXUnitViewer(_param0 *opts.CommonOptions) *MockXUnitClient_EnsureXUnitViewer_OngoingVerification { 164 params := []pegomock.Param{_param0} 165 methodInvocations := pegomock.GetGenericMockFrom(verifier.mock).Verify(verifier.inOrderContext, verifier.invocationCountMatcher, "EnsureXUnitViewer", params, verifier.timeout) 166 return &MockXUnitClient_EnsureXUnitViewer_OngoingVerification{mock: verifier.mock, methodInvocations: methodInvocations} 167 } 168 169 type MockXUnitClient_EnsureXUnitViewer_OngoingVerification struct { 170 mock *MockXUnitClient 171 methodInvocations []pegomock.MethodInvocation 172 } 173 174 func (c *MockXUnitClient_EnsureXUnitViewer_OngoingVerification) GetCapturedArguments() *opts.CommonOptions { 175 _param0 := c.GetAllCapturedArguments() 176 return _param0[len(_param0)-1] 177 } 178 179 func (c *MockXUnitClient_EnsureXUnitViewer_OngoingVerification) GetAllCapturedArguments() (_param0 []*opts.CommonOptions) { 180 params := pegomock.GetGenericMockFrom(c.mock).GetInvocationParams(c.methodInvocations) 181 if len(params) > 0 { 182 _param0 = make([]*opts.CommonOptions, len(c.methodInvocations)) 183 for u, param := range params[0] { 184 _param0[u] = param.(*opts.CommonOptions) 185 } 186 } 187 return 188 }