/**
 * @File Name          : QBInvoiceQueryJSON_Test.cls
 * @Description        : 
 * @Author             : jawills
 * @Group              : 
 * @Last Modified By   : jawills
 * @Last Modified On   : 2019-10-06, 11:10:53 p.m.
 * @Modification Log   : 
 * Ver       Date            Author      		    Modification
 * 1.0    2019-10-06   jawills     Initial Version
**/
//
// Generated by JSON2Apex http://json2apex.herokuapp.com/
//

@IsTest
public class QBInvoiceQueryJSON_Test {

	public static String json = '{'+
	'    \"QueryResponse\": {'+
	'        \"Invoice\": ['+
	'            {'+
	'                \"Deposit\": 0,'+
	'                \"AllowIPNPayment\": false,'+
	'                \"AllowOnlinePayment\": false,'+
	'                \"AllowOnlineCreditCardPayment\": false,'+
	'                \"AllowOnlineACHPayment\": false,'+
	'                \"domain\": \"QBO\",'+
	'                \"sparse\": false,'+
	'                \"Id\": \"147\",'+
	'                \"SyncToken\": \"3\",'+
	'                \"MetaData\": {'+
	'                    \"CreateTime\": \"2019-10-06T21:06:24-07:00\",'+
	'                    \"LastUpdatedTime\": \"2019-10-06T22:20:47-07:00\"'+
	'                },'+
	'                \"CustomField\": ['+
	'                    {'+
	'                        \"DefinitionId\": \"1\",'+
	'                        \"Type\": \"StringType\"'+
	'                    }'+
	'                ],'+
	'                \"DocNumber\": \"1040\",'+
	'                \"TxnDate\": \"2019-10-06\",'+
	'                \"CurrencyRef\": {'+
	'                    \"value\": \"USD\",'+
	'                    \"name\": \"United States Dollar\"'+
	'                },'+
	'                \"LinkedTxn\": [],'+
	'                \"Line\": ['+
	'                    {'+
	'                        \"Id\": \"3\",'+
	'                        \"LineNum\": 1,'+
	'                        \"Amount\": 1000.00,'+
	'                        \"DetailType\": \"SalesItemLineDetail\",'+
	'                        \"SalesItemLineDetail\": {'+
	'                            \"ItemRef\": {'+
	'                                \"value\": \"19\",'+
	'                                \"name\": \"Services\"'+
	'                            },'+
	'                            \"ItemAccountRef\": {'+
	'                                \"value\": \"124\",'+
	'                                \"name\": \"Services\"'+
	'                            },'+
	'                            \"TaxCodeRef\": {'+
	'                                \"value\": \"NON\"'+
	'                            }'+
	'                        }'+
	'                    },'+
	'                    {'+
	'                        \"Amount\": 1000.00,'+
	'                        \"DetailType\": \"SubTotalLineDetail\",'+
	'                        \"SubTotalLineDetail\": {}'+
	'                    }'+
	'                ],'+
	'                \"CustomerRef\": {'+
	'                    \"value\": \"65\",'+
	'                    \"name\": \"Test Account\"'+
	'                },'+
	'                \"SalesTermRef\": {'+
	'                    \"value\": \"7\"'+
	'                },'+
	'                \"DueDate\": \"2019-10-21\",'+
	'                \"TotalAmt\": 1000.00,'+
	'                \"ApplyTaxAfterDiscount\": false,'+
	'                \"PrintStatus\": \"NeedToPrint\",'+
	'                \"EmailStatus\": \"NotSet\",'+
	'                \"Balance\": 1000.00'+
	'            }'+
	'        ],'+
	'        \"startPosition\": 1,'+
	'        \"maxResults\": 3,'+
	'        \"totalCount\": 3'+
	'    },'+
	'    \"time\": \"2019-10-06T23:08:55.920-07:00\"'+
	'}';
	
	// This test method should give 100% coverage
	static testMethod void testParse() {

		QBInvoiceQueryJSON r = QBInvoiceQueryJSON.parse(json);
		System.assert(r != null);

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBInvoiceQueryJSON.Invoice objInvoice = new QBInvoiceQueryJSON.Invoice(System.JSON.createParser(json));
		System.assert(objInvoice != null);
		System.assert(objInvoice.Deposit == null);
		System.assert(objInvoice.AllowIPNPayment == null);
		System.assert(objInvoice.AllowOnlinePayment == null);
		System.assert(objInvoice.AllowOnlineCreditCardPayment == null);
		System.assert(objInvoice.AllowOnlineACHPayment == null);
		System.assert(objInvoice.domain == null);
		System.assert(objInvoice.sparse == null);
		System.assert(objInvoice.Id == null);
		System.assert(objInvoice.SyncToken == null);
		System.assert(objInvoice.MetaData == null);
		System.assert(objInvoice.CustomField == null);
		System.assert(objInvoice.DocNumber == null);
		System.assert(objInvoice.TxnDate == null);
		System.assert(objInvoice.CurrencyRef == null);
		System.assert(objInvoice.LinkedTxn == null);
		System.assert(objInvoice.Line == null);
		System.assert(objInvoice.CustomerRef == null);
		System.assert(objInvoice.SalesTermRef == null);
		System.assert(objInvoice.DueDate == null);
		System.assert(objInvoice.TotalAmt == null);
		System.assert(objInvoice.ApplyTaxAfterDiscount == null);
		System.assert(objInvoice.PrintStatus == null);
		System.assert(objInvoice.EmailStatus == null);
		System.assert(objInvoice.Balance == null);
		System.assert(objInvoice.CustomerMemo == null);

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

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

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBInvoiceQueryJSON.Line objLine = new QBInvoiceQueryJSON.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\" } ] } }';
		QBInvoiceQueryJSON.SalesItemLineDetail_Z objSalesItemLineDetail_Z = new QBInvoiceQueryJSON.SalesItemLineDetail_Z(System.JSON.createParser(json));
		System.assert(objSalesItemLineDetail_Z != null);
		System.assert(objSalesItemLineDetail_Z.ItemRef == null);
		System.assert(objSalesItemLineDetail_Z.UnitPrice == null);
		System.assert(objSalesItemLineDetail_Z.Qty == null);
		System.assert(objSalesItemLineDetail_Z.ItemAccountRef == null);
		System.assert(objSalesItemLineDetail_Z.TaxCodeRef == null);

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBInvoiceQueryJSON objQBInvoiceQueryJSON = new QBInvoiceQueryJSON(System.JSON.createParser(json));
		System.assert(objQBInvoiceQueryJSON != null);
		System.assert(objQBInvoiceQueryJSON.QueryResponse == null);
		//System.assert(objQBInvoiceQueryJSON.time == null);

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBInvoiceQueryJSON.MetaData objMetaData = new QBInvoiceQueryJSON.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\" } ] } }';
		QBInvoiceQueryJSON.QueryResponse objQueryResponse = new QBInvoiceQueryJSON.QueryResponse(System.JSON.createParser(json));
		System.assert(objQueryResponse != null);
		System.assert(objQueryResponse.Invoice == null);
		System.assert(objQueryResponse.startPosition == null);
		System.assert(objQueryResponse.maxResults == null);
		System.assert(objQueryResponse.totalCount == null);

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

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