//
// Generated by JSON2Apex http://json2apex.herokuapp.com/
//

@IsTest
public class QBSalesReceiptQueryJSON_Test {
  public static String json =
    '{' +
    '    \"QueryResponse\": {' +
    '        \"SalesReceipt\": [' +
    '            {' +
    '                \"domain\": \"QBO\",' +
    '                \"sparse\": false,' +
    '                \"Id\": \"18084\",' +
    '                \"SyncToken\": \"2\",' +
    '                \"MetaData\": {' +
    '                    \"CreateTime\": \"2022-05-19T01:08:16-07:00\",' +
    '                    \"LastUpdatedTime\": \"2022-05-19T01:10:01-07:00\"' +
    '                },' +
    '                \"CustomField\": [],' +
    '                \"DocNumber\": \"5214\",' +
    '                \"TxnDate\": \"2022-05-19\",' +
    '                \"DepartmentRef\": {' +
    '                    \"value\": \"1\",' +
    '                    \"name\": \"TEST\"' +
    '                },' +
    '                \"CurrencyRef\": {' +
    '                    \"value\": \"USD\",' +
    '                    \"name\": \"United States Dollar\"' +
    '                },' +
    '                \"Line\": [' +
    '                    {' +
    '                        \"Id\": \"1\",' +
    '                        \"LineNum\": 1,' +
    '                        \"Amount\": 89.00,' +
    '                        \"DetailType\": \"SalesItemLineDetail\",' +
    '                        \"SalesItemLineDetail\": {' +
    '                            \"ItemRef\": {' +
    '                                \"value\": \"3\",' +
    '                                \"name\": \"Test\"' +
    '                            },' +
    '                            \"UnitPrice\": 89,' +
    '                            \"Qty\": 1,' +
    '                            \"TaxCodeRef\": {' +
    '                                \"value\": \"TAX\"' +
    '                            }' +
    '                        }' +
    '                    },' +
    '                    {' +
    '                        \"Id\": \"2\",' +
    '                        \"LineNum\": 1,' +
    '                        \"Amount\": 89.00,' +
    '                        \"DetailType\": \"GroupLineDetail\",' +
    '                        \"GroupLineDetail\": {' +
    '\"Line\": [' +
    '{' +
    '\"Id\": \"2\",' +
    '\"LineNum\": 2,' +
    '\"Description\": \"TEST\",' +
    '\"Amount\": 6750.00,' +
    '\"DetailType\": \"SalesItemLineDetail\",' +
    '\"SalesItemLineDetail\": {' +
    '\"ItemRef\": {' +
    '\"value\": \"314\",' +
    '\"name\": \"TEST\"' +
    '},' +
    '\"UnitPrice\": 1350,' +
    '\"Qty\": 5,' +
    '\"TaxCodeRef\": {' +
    '\"value\": \"TAX\"' +
    '}' +
    '}' +
    '}],' +
    '                        \"GroupItemRef\": {' +
    '\"value\": \"525\",' +
    '\"name\": \"Test\"' +
    '},' +
    '                            \"UnitPrice\": 89,' +
    '                            \"Qty\": 1,' +
    '                            \"TaxCodeRef\": {' +
    '                                \"value\": \"TAX\"' +
    '                            }' +
    '                        }' +
    '                    },' +
    '                    {' +
    '                        \"Amount\": 89.00,' +
    '                        \"DetailType\": \"SubTotalLineDetail\",' +
    '                        \"SubTotalLineDetail\": {}' +
    '                    }' +
    '                ],' +
    '                \"TxnTaxDetail\": {' +
    '                    \"TxnTaxCodeRef\": {' +
    '                        \"value\": \"3\"' +
    '                    },' +
    '                    \"TotalTax\": 7.34,' +
    '                    \"TaxLine\": [' +
    '                        {' +
    '                            \"Amount\": 0.89,' +
    '                            \"DetailType\": \"TaxLineDetail\",' +
    '                            \"TaxLineDetail\": {' +
    '                                \"TaxRateRef\": {' +
    '                                    \"value\": \"4\"' +
    '                                },' +
    '                                \"PercentBased\": true,' +
    '                                \"TaxPercent\": 1,' +
    '                                \"NetAmountTaxable\": 89.00' +
    '                            }' +
    '                        },' +
    '                        {' +
    '                            \"Amount\": 0.89,' +
    '                            \"DetailType\": \"TaxLineDetail\",' +
    '                            \"TaxLineDetail\": {' +
    '                                \"TaxRateRef\": {' +
    '                                    \"value\": \"5\"' +
    '                                },' +
    '                                \"PercentBased\": true,' +
    '                                \"TaxPercent\": 1,' +
    '                                \"NetAmountTaxable\": 89.00' +
    '                            }' +
    '                        },' +
    '                        {' +
    '                            \"Amount\": 5.56,' +
    '                            \"DetailType\": \"TaxLineDetail\",' +
    '                            \"TaxLineDetail\": {' +
    '                                \"TaxRateRef\": {' +
    '                                    \"value\": \"3\"' +
    '                                },' +
    '                                \"PercentBased\": true,' +
    '                                \"TaxPercent\": 6.25,' +
    '                                \"NetAmountTaxable\": 89.00' +
    '                            }' +
    '                        }' +
    '                    ]' +
    '                },' +
    '                \"CustomerRef\": {' +
    '                    \"value\": \"47\",' +
    '                    \"name\": \"TEST\"' +
    '                },' +
    '                \"TotalAmt\": 96.34,' +
    '                \"ApplyTaxAfterDiscount\": false,' +
    '                \"PrintStatus\": \"NotSet\",' +
    '                \"EmailStatus\": \"EmailSent\",' +
    '                \"BillEmail\": {' +
    '                    \"Address\": \"test@test.com\"' +
    '                },' +
    '                \"Balance\": 0,' +
    '                \"PaymentMethodRef\": {' +
    '                    \"value\": \"3\",' +
    '                    \"name\": \"Credit Card\"' +
    '                },' +
    '                \"CreditCardPayment\": {' +
    '                    \"CreditChargeInfo\": {' +
    '                        \"CcExpiryMonth\": 1,' +
    '                        \"CcExpiryYear\": 2024,' +
    '                        \"Amount\": 100.34' +
    '                    },' +
    '                    \"CreditChargeResponse\": {' +
    '                        \"CCTransId\": \"1234\",' +
    '                        \"Status\": \"Completed\",' +
    '                        \"CardSecurityCodeMatch\": \"NotAvailable\",' +
    '                        \"AuthCode\": \"12354\",' +
    '                        \"AvsStreet\": \"NotAvailable\",' +
    '                        \"AvsZip\": \"NotAvailable\",' +
    '                        \"TxnAuthorizationTime\": \"2024-01-19T00:00:00-07:00\"' +
    '                    }' +
    '                },' +
    '                \"DepositToAccountRef\": {' +
    '                    \"value\": \"46\",' +
    '                    \"name\": \"Undeposited Funds\"' +
    '                },' +
    '                \"DeliveryInfo\": {' +
    '                    \"DeliveryType\": \"Email\",' +
    '                    \"DeliveryTime\": \"2024-01-01T01:10:01-07:00\"' +
    '                }' +
    '            }' +
    '        ],' +
    '        \"startPosition\": 1,' +
    '        \"maxResults\": 1' +
    '    },' +
    '    \"time\": \"2024-01-01T12:38:11.044-07:00\"' +
    '}';
  // This test method should give 100% coverage
  static testMethod void testParse() {
    QBSalesReceiptQueryJSON r = QBSalesReceiptQueryJSON.parse(json);
    System.assert(r != null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.TaxLineDetail_Z objTaxLineDetail_Z = new QBSalesReceiptQueryJSON.TaxLineDetail_Z(
      System.JSON.createParser(json)
    );
    System.assert(objTaxLineDetail_Z != null);
    System.assert(objTaxLineDetail_Z.TaxRateRef == null);
    System.assert(objTaxLineDetail_Z.PercentBased == null);
    System.assert(objTaxLineDetail_Z.TaxPercent == null);
    System.assert(objTaxLineDetail_Z.NetAmountTaxable == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.CreditChargeResponse objCreditChargeResponse = new QBSalesReceiptQueryJSON.CreditChargeResponse(
      System.JSON.createParser(json)
    );
    System.assert(objCreditChargeResponse != null);
    System.assert(objCreditChargeResponse.CCTransId == null);
    System.assert(objCreditChargeResponse.Status == null);
    System.assert(objCreditChargeResponse.CardSecurityCodeMatch == null);
    System.assert(objCreditChargeResponse.AuthCode == null);
    System.assert(objCreditChargeResponse.AvsStreet == null);
    System.assert(objCreditChargeResponse.AvsZip == null);
    System.assert(objCreditChargeResponse.TxnAuthorizationTime == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.SalesItemLineDetail objSalesItemLineDetail = new QBSalesReceiptQueryJSON.SalesItemLineDetail(
      System.JSON.createParser(json)
    );
    System.assert(objSalesItemLineDetail != null);
    System.assert(objSalesItemLineDetail.ItemRef == null);
    System.assert(objSalesItemLineDetail.UnitPrice == null);
    System.assert(objSalesItemLineDetail.Qty == null);
    System.assert(objSalesItemLineDetail.TaxCodeRef == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.DepartmentRef objDepartmentRef = new QBSalesReceiptQueryJSON.DepartmentRef(
      System.JSON.createParser(json)
    );
    System.assert(objDepartmentRef != null);
    System.assert(objDepartmentRef.value == null);
    System.assert(objDepartmentRef.name == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.DeliveryInfo objDeliveryInfo = new QBSalesReceiptQueryJSON.DeliveryInfo(
      System.JSON.createParser(json)
    );
    System.assert(objDeliveryInfo != null);
    System.assert(objDeliveryInfo.DeliveryType == null);
    System.assert(objDeliveryInfo.DeliveryTime == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.TaxLine objTaxLine = new QBSalesReceiptQueryJSON.TaxLine(
      System.JSON.createParser(json)
    );
    System.assert(objTaxLine != null);
    System.assert(objTaxLine.Amount == null);
    System.assert(objTaxLine.DetailType == null);
    System.assert(objTaxLine.TaxLineDetail == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.Line objLine = new QBSalesReceiptQueryJSON.Line(
      System.JSON.createParser(json)
    );
    System.assert(objLine != null);
    System.assert(objLine.Id == null);
    System.assert(objLine.LineNum == null);
    System.assert(objLine.Amount == null);
    System.assert(objLine.DetailType == null);
    System.assert(objLine.SalesItemLineDetail == null);
    System.assert(objLine.SubTotalLineDetail == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.CreditCardPayment objCreditCardPayment = new QBSalesReceiptQueryJSON.CreditCardPayment(
      System.JSON.createParser(json)
    );
    System.assert(objCreditCardPayment != null);
    System.assert(objCreditCardPayment.CreditChargeInfo == null);
    System.assert(objCreditCardPayment.CreditChargeResponse == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.SalesReceipt objSalesReceipt = new QBSalesReceiptQueryJSON.SalesReceipt(
      System.JSON.createParser(json)
    );
    System.assert(objSalesReceipt != null);
    System.assert(objSalesReceipt.domain == null);
    System.assert(objSalesReceipt.sparse == null);
    System.assert(objSalesReceipt.Id == null);
    System.assert(objSalesReceipt.SyncToken == null);
    System.assert(objSalesReceipt.MetaData == null);
    System.assert(objSalesReceipt.CustomField == null);
    System.assert(objSalesReceipt.DocNumber == null);
    System.assert(objSalesReceipt.TxnDate == null);
    System.assert(objSalesReceipt.DepartmentRef == null);
    System.assert(objSalesReceipt.CurrencyRef == null);
    System.assert(objSalesReceipt.Line == null);
    System.assert(objSalesReceipt.TxnTaxDetail == null);
    System.assert(objSalesReceipt.CustomerRef == null);
    System.assert(objSalesReceipt.TotalAmt == null);
    System.assert(objSalesReceipt.ApplyTaxAfterDiscount == null);
    System.assert(objSalesReceipt.PrintStatus == null);
    System.assert(objSalesReceipt.EmailStatus == null);
    System.assert(objSalesReceipt.BillEmail == null);
    System.assert(objSalesReceipt.Balance == null);
    System.assert(objSalesReceipt.PaymentMethodRef == null);
    System.assert(objSalesReceipt.CreditCardPayment == null);
    System.assert(objSalesReceipt.DepositToAccountRef == null);
    System.assert(objSalesReceipt.DeliveryInfo == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON objQBSalesReceiptQueryJSON = new QBSalesReceiptQueryJSON(
      System.JSON.createParser(json)
    );
    System.assert(objQBSalesReceiptQueryJSON != null);
    System.assert(objQBSalesReceiptQueryJSON.QueryResponse == null);
    System.assert(objQBSalesReceiptQueryJSON.time_Z == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.TaxCodeRef objTaxCodeRef = new QBSalesReceiptQueryJSON.TaxCodeRef(
      System.JSON.createParser(json)
    );
    System.assert(objTaxCodeRef != null);
    System.assert(objTaxCodeRef.value == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.MetaData objMetaData = new QBSalesReceiptQueryJSON.MetaData(
      System.JSON.createParser(json)
    );
    System.assert(objMetaData != null);
    System.assert(objMetaData.CreateTime == null);
    System.assert(objMetaData.LastUpdatedTime == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.TaxLineDetail objTaxLineDetail = new QBSalesReceiptQueryJSON.TaxLineDetail(
      System.JSON.createParser(json)
    );
    System.assert(objTaxLineDetail != null);
    System.assert(objTaxLineDetail.TaxRateRef == null);
    System.assert(objTaxLineDetail.PercentBased == null);
    System.assert(objTaxLineDetail.TaxPercent == null);
    System.assert(objTaxLineDetail.NetAmountTaxable == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.QueryResponse objQueryResponse = new QBSalesReceiptQueryJSON.QueryResponse(
      System.JSON.createParser(json)
    );
    System.assert(objQueryResponse != null);
    System.assert(objQueryResponse.SalesReceipt == null);
    System.assert(objQueryResponse.startPosition == null);
    System.assert(objQueryResponse.maxResults == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.CustomField objCustomField = new QBSalesReceiptQueryJSON.CustomField(
      System.JSON.createParser(json)
    );
    System.assert(objCustomField != null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.CreditChargeInfo objCreditChargeInfo = new QBSalesReceiptQueryJSON.CreditChargeInfo(
      System.JSON.createParser(json)
    );
    System.assert(objCreditChargeInfo != null);
    System.assert(objCreditChargeInfo.CcExpiryMonth == null);
    System.assert(objCreditChargeInfo.CcExpiryYear == null);
    System.assert(objCreditChargeInfo.Amount == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.BillEmail objBillEmail = new QBSalesReceiptQueryJSON.BillEmail(
      System.JSON.createParser(json)
    );
    System.assert(objBillEmail != null);
    System.assert(objBillEmail.Address == null);

    json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
    QBSalesReceiptQueryJSON.TxnTaxDetail objTxnTaxDetail = new QBSalesReceiptQueryJSON.TxnTaxDetail(
      System.JSON.createParser(json)
    );
    System.assert(objTxnTaxDetail != null);
    System.assert(objTxnTaxDetail.TxnTaxCodeRef == null);
    System.assert(objTxnTaxDetail.TotalTax == null);
    System.assert(objTxnTaxDetail.TaxLine == null);
  }
}
