# Mocking Methods

Once you have created a mock object, you can use it like the real object as it will respond exactly as it was coded. However, you can override its behavior by using the mocking methods that have been placed on the mocked object at run-time. The methods that you can call upon in your object are the following (we will review them in detail later):

| Method Name               | Return Type | Description                                                                                                                                                                                               |
| ------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $()                       | The Mock    | Used to mock a method on the mock object that can return, throw or be a void method.                                                                                                                      |
| $property()               | The Mock    | Mock a property in the object on any scope.                                                                                                                                                               |
| $getProperty(name, scope) | any         | Retrieve any public or private internal state variable so you can do assertions and more mocking.                                                                                                         |
| $results()                | The Mock    | Mock 1 or more results of a mock method call, must be chained to a $() or $().$args() call                                                                                                                |
| $args()                   | The Mock    | Mock 1 or more arguments in sequential or named order. Must be called concatenated to a $() call and must be followed by a concatenated $results() call so the results are matched to specific arguments. |
| querySim()                | query       | to denote columns. Ex: id, name 1  Luis Majano 2 Joe Louis                                                                                                                                                |


---

# 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/v2.x-1/mocking/mockbox/mocking-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.
