| 503 | } |
| 504 | |
| 505 | func Test_Mock_On_WithVariadicFuncWithEmptyInterfaceArray(t *testing.T) { |
| 506 | t.Parallel() |
| 507 | |
| 508 | // make a test impl object |
| 509 | var mockedService = new(TestExampleImplementation) |
| 510 | |
| 511 | var expected []interface{} |
| 512 | c := mockedService. |
| 513 | On("TheExampleMethodVariadicInterface", expected). |
| 514 | Return(nil) |
| 515 | |
| 516 | assert.Equal(t, []*Call{c}, mockedService.ExpectedCalls) |
| 517 | assert.Equal(t, 1, len(c.Arguments)) |
| 518 | assert.Equal(t, expected, c.Arguments[0]) |
| 519 | |
| 520 | assert.NotPanics(t, func() { |
| 521 | mockedService.TheExampleMethodVariadicInterface() |
| 522 | }) |
| 523 | assert.Panics(t, func() { |
| 524 | mockedService.TheExampleMethodVariadicInterface(1, 2) |
| 525 | }) |
| 526 | |
| 527 | } |
| 528 | |
| 529 | func Test_Mock_On_WithFuncPanics(t *testing.T) { |
| 530 | t.Parallel() |