NotBefore indicates that the mock should only be called after the referenced calls have been called as expected. The referenced calls may be from the same mock instance and/or other mock instances. Mock.On("Do").Return(nil).NotBefore( Mock.On("Init").Return(nil) )
(calls ...*Call)
| 267 | // Mock.On("Init").Return(nil) |
| 268 | // ) |
| 269 | func (c *Call) NotBefore(calls ...*Call) *Call { |
| 270 | c.lock() |
| 271 | defer c.unlock() |
| 272 | |
| 273 | for _, call := range calls { |
| 274 | if call.Parent == nil { |
| 275 | panic("not before calls must be created with Mock.On()") |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | c.requires = append(c.requires, calls...) |
| 280 | return c |
| 281 | } |
| 282 | |
| 283 | // InOrder defines the order in which the calls should be made |
| 284 | // |