# Verification Methods

The following methods are also mixed in at run-time into mock objects and they will be used to verify behavior and calls from these mock/stub objects. These are great in order to find out how many mocked methods calls have been made and to find out the arguments that where passed to each mocked method call.

| Method Name                                                          | Return Type | Description                                                                                                                       |
| -------------------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| $count(\[methodName])                                                | Numeric     | Get the number of times all mocked methods have been called on a mock or pass in a method name and get a the method's call count. |
| $times(count,\[methodName]) or $verifyCallCount(count,\[methodName]) | Numeric     | Assert how many calls have been made to the mock or a specific mock method                                                        |
| $never(\[methodName])                                                | Boolean     | Assert that no interactions have been made to the mock or a specific mock method: Alias to $times(0)                              |
| $atLeast(minNumberOfInvocations,\[methodName])                       | Boolean     | Assert that at least a certain number of calls have been made on the mock or a specific mock method                               |
| $once(\[methodName])                                                 | Boolean     | Assert that only 1 call has been made on the mock or a specific mock method                                                       |
| $atMost(maxNumberOfInvocations, \[methodName])                       | Boolean     | Assert that at most a certain number of calls have been made on the mock or a specific mock method.                               |
| $callLog()                                                           | struct      | Retrieve the method call logger structure of all mocked method calls.                                                             |
| $reset()                                                             | void        | Reset all mock counters and logs on the targeted mock.                                                                            |
| $debug()                                                             | struct      | Retrieve a structure of mocking debugging information about a mock object.                                                        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testbox.ortusbooks.com/mocking/mockbox/verification-methods.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
