# Testing
source: https://developer.mastercard.com/mastercard-send-avs/documentation/testing/index.md

## Sandbox Testing {#sandbox-testing}

The Sandbox server returns simulated responses, enabling you to try this API quickly, and should not be used for full integration testing. For valid test card numbers that you can use in your requests, see [Sandbox Test Cards](https://developer.mastercard.com/mastercard-send/documentation/implementation/sandbox-test-cards/).

### Test Scenarios {#test-scenarios}

Use the following test scenarios to produce specific responses. As long as the request message is properly formatted, a valid response will be returned.

|             Test Scenario             |                  Test Data                   | HTTP Status Code/Reason Code |                 Expected Result                  |
|---------------------------------------|----------------------------------------------|------------------------------|--------------------------------------------------|
| Address, postal code, and CVC matched | `account_uri` = pan:5204740000003362         | 200/OK                       | All status values MATCHED                        |
| Invalid value                         | `account_uri` = ABC                          | 400/INVALID_INPUT_VALUE      | Error: Invalid value (082000)                    |
| Invalid field length                  | `account_verification_reference` = 1         | 400/INVALID_INPUT_LENGTH     | Error: Invalid length (072000)                   |
| Invalid field format                  | `account_uri` = pan:ABC                      | 400/INVALID_INPUT_FORMAT     | Error: Value contains invalid character (062000) |
| Missing required field                | Omit a required field, such as `account_uri` | 400/MISSING_REQUIRED_INPUT   | Error: Value is required (092000)                |

## MTF Testing {#mtf-testing}

### Test Card Numbers and Associated Networks {#test-card-numbers-and-associated-networks}

For test card numbers that you can use for testing in the MTF environment, see [MTF Test Cards](https://developer.mastercard.com/mastercard-send/documentation/implementation/test-cards/).

Do not use consumer card numbers in the test environment.

### Sample Data {#sample-data}

|  Network   |                Name                |                    Account URI                     |                                                        Address                                                         |                          Response Status                          |
|------------|------------------------------------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------|
| Visa       | first_name: Dicky, last_name: Bird | pan:4000289999999916;exp=2077-12;cvc=231           | line1: 1 Main Street, line2: Apartment 11, city: HAGEN, country_subdivision: MT, postal_code: 63368-3784, country: USA | address_status, postal_code_status and cvc_status will be MATCHED |
| Mastercard | first_name: Dicky, last_name: Bird | pan:{test-account};exp=2077-12;cvc=234 *See below* | line1: 1 Main Street, line2: Apartment 11, city: HAGEN, country_subdivision: MT, postal_code: 63368-3784, country: USA | *See below (Expected Results)*                                    |

For {test-account}, you can use the following Mastercard test account numbers to get success responses with different response values. Specify the account number in the Account URI field using the pan schema, for example `pan:5204740000004501;exp=2077-12;cvc=234`.

|                           Test Case                           |   Test Account   |                           Expected Results                            |
|---------------------------------------------------------------|------------------|-----------------------------------------------------------------------|
| Valid card and address with 9-digit postal code               | 5204740000004501 | All fields matched                                                    |
| Valid card and address with 5-digit postal code               | 5204740000004600 | All fields matched                                                    |
| Valid address and card with invalid CVC                       | 5204740000003362 | CVC not matched                                                       |
| Valid address and card with CVC not processed                 | 5204740000003370 | CVC not verified                                                      |
| Valid address and card with CVC issuer not certified          | 5204740000089056 | CVC not verified and the response description as issuer not certified |
| Valid card and address with invalid postal code               | 5204740000004311 | Postal code not matched                                               |
| Valid card with issuer not having any data                    | 5204740000004352 | Address and postal fields not verified, CVC matched                   |
| Valid card and address with invalid postal code and address   | 5204740000004337 | Postal code and address not matched                                   |
| Valid card with AVS not supported                             | 5204740000004394 | Postal code and address not verified                                  |
| Valid card and invalid address with valid 5-digit postal code | 5204740000004709 | Address not matched                                                   |
| Valid card and invalid address with valid 9-digit postal code | 5204740000004808 | Address not matched                                                   |
| Valid details, but system unable to process                   | 5204740000004378 | Address and postal code fields not verified and CVC matched           |
| Valid card without CVC                                        | 5204740000003370 | CVC not verified                                                      |

