| 255 | } |
| 256 | |
| 257 | func Test_Mock_On_WithIntArgMatcher(t *testing.T) { |
| 258 | t.Parallel() |
| 259 | |
| 260 | var mockedService TestExampleImplementation |
| 261 | |
| 262 | mockedService.On("TheExampleMethod", |
| 263 | MatchedBy(func(a int) bool { |
| 264 | return a == 1 |
| 265 | }), MatchedBy(func(b int) bool { |
| 266 | return b == 2 |
| 267 | }), MatchedBy(func(c int) bool { |
| 268 | return c == 3 |
| 269 | })).Return(0, nil) |
| 270 | |
| 271 | assert.Panics(t, func() { |
| 272 | mockedService.TheExampleMethod(1, 2, 4) |
| 273 | }) |
| 274 | assert.Panics(t, func() { |
| 275 | mockedService.TheExampleMethod(2, 2, 3) |
| 276 | }) |
| 277 | assert.NotPanics(t, func() { |
| 278 | mockedService.TheExampleMethod(1, 2, 3) |
| 279 | }) |
| 280 | } |
| 281 | |
| 282 | func Test_Mock_On_WithArgMatcherThatPanics(t *testing.T) { |
| 283 | t.Parallel() |