(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func Test_Mock_On_WithFuncArg(t *testing.T) { |
| 236 | t.Parallel() |
| 237 | |
| 238 | // make a test impl object |
| 239 | var mockedService = new(TestExampleImplementation) |
| 240 | |
| 241 | c := mockedService. |
| 242 | On("TheExampleMethodFunc", AnythingOfType("func(string) error")). |
| 243 | Return(nil) |
| 244 | |
| 245 | assert.Equal(t, []*Call{c}, mockedService.ExpectedCalls) |
| 246 | assert.Equal(t, "TheExampleMethodFunc", c.Method) |
| 247 | assert.Equal(t, 1, len(c.Arguments)) |
| 248 | assert.Equal(t, AnythingOfType("func(string) error"), c.Arguments[0]) |
| 249 | |
| 250 | fn := func(string) error { return nil } |
| 251 | |
| 252 | assert.NotPanics(t, func() { |
| 253 | mockedService.TheExampleMethodFunc(fn) |
| 254 | }) |
| 255 | } |
| 256 | |
| 257 | func Test_Mock_On_WithIntArgMatcher(t *testing.T) { |
| 258 | t.Parallel() |
nothing calls this directly
no test coverage detected