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

@IsTest
public class QBPaymentQueryJSON_Test {

    public static String json = '{'+
    '  \"QueryResponse\": {'+
    '    \"startPosition\": 1, '+
    '    \"Payment\": ['+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 55.0, '+
    '        \"TxnDate\": \"2015-01-16\", '+
    '        \"TotalAmt\": 55.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": [], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"161\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-01-16T14:58:32-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-01-16T14:58:32-08:00\"'+
    '        }'+
    '      }, '+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 65.0, '+
    '        \"TxnDate\": \"2015-01-16\", '+
    '        \"TotalAmt\": 65.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": [], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"162\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-01-16T14:58:59-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-01-16T14:58:59-08:00\"'+
    '        }'+
    '      }, '+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 10.0, '+
    '        \"TxnDate\": \"2015-01-16\", '+
    '        \"TotalAmt\": 65.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": ['+
    '          {'+
    '            \"Amount\": 55.0, '+
    '            \"LineEx\": {'+
    '              \"any\": ['+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnId\", '+
    '                    \"Value\": \"70\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnOpenBalance\", '+
    '                    \"Value\": \"71.00\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnReferenceNumber\", '+
    '                    \"Value\": \"1024\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }'+
    '              ]'+
    '            }, '+
    '            \"LinkedTxn\": ['+
    '              {'+
    '                \"TxnId\": \"70\", '+
    '                \"TxnType\": \"Invoice\"'+
    '              }'+
    '            ]'+
    '          }'+
    '        ], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"163\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-01-16T15:08:12-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-01-16T15:08:12-08:00\"'+
    '        }'+
    '      }, '+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 245.0, '+
    '        \"TxnDate\": \"2015-01-16\", '+
    '        \"TotalAmt\": 300.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": ['+
    '          {'+
    '            \"Amount\": 55.0, '+
    '            \"LineEx\": {'+
    '              \"any\": ['+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnId\", '+
    '                    \"Value\": \"70\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnOpenBalance\", '+
    '                    \"Value\": \"71.00\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnReferenceNumber\", '+
    '                    \"Value\": \"1024\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }'+
    '              ]'+
    '            }, '+
    '            \"LinkedTxn\": ['+
    '              {'+
    '                \"TxnId\": \"70\", '+
    '                \"TxnType\": \"Invoice\"'+
    '              }'+
    '            ]'+
    '          }'+
    '        ], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"164\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-01-16T15:09:22-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-01-16T15:09:22-08:00\"'+
    '        }'+
    '      }, '+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 0, '+
    '        \"TxnDate\": \"2015-02-04\", '+
    '        \"TotalAmt\": 15.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": ['+
    '          {'+
    '            \"Amount\": 15.0, '+
    '            \"LineEx\": {'+
    '              \"any\": ['+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnId\", '+
    '                    \"Value\": \"70\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnOpenBalance\", '+
    '                    \"Value\": \"31.00\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }, '+
    '                {'+
    '                  \"name\": \"{http://schema.intuit.com/finance/v3}NameValue\", '+
    '                  \"nil\": false, '+
    '                  \"value\": {'+
    '                    \"Name\": \"txnReferenceNumber\", '+
    '                    \"Value\": \"1024\"'+
    '                  }, '+
    '                  \"declaredType\": \"com.intuit.schema.finance.v3.NameValue\", '+
    '                  \"scope\": \"javax.xml.bind.JAXBElement$GlobalScope\", '+
    '                  \"globalScope\": true, '+
    '                  \"typeSubstituted\": false'+
    '                }'+
    '              ]'+
    '            }, '+
    '            \"LinkedTxn\": ['+
    '              {'+
    '                \"TxnId\": \"70\", '+
    '                \"TxnType\": \"Invoice\"'+
    '              }'+
    '            ]'+
    '          }'+
    '        ], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"170\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-02-04T10:42:16-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-02-04T10:42:16-08:00\"'+
    '        }'+
    '      }, '+
    '      {'+
    '        \"SyncToken\": \"0\", '+
    '        \"domain\": \"QBO\", '+
    '        \"DepositToAccountRef\": {'+
    '          \"value\": \"4\"'+
    '        }, '+
    '        \"UnappliedAmt\": 55.0, '+
    '        \"TxnDate\": \"2015-02-04\", '+
    '        \"TotalAmt\": 55.0, '+
    '        \"ProcessPayment\": false, '+
    '        \"sparse\": false, '+
    '        \"Line\": [], '+
    '        \"CustomerRef\": {'+
    '          \"name\": \"Red Rock Diner\", '+
    '          \"value\": \"20\"'+
    '        }, '+
    '        \"Id\": \"171\", '+
    '        \"MetaData\": {'+
    '          \"CreateTime\": \"2015-02-04T10:42:33-08:00\", '+
    '          \"LastUpdatedTime\": \"2015-02-04T10:42:33-08:00\"'+
    '        }'+
    '      }'+
    '    ], '+
    '    \"maxResults\": 6'+
    '  }, '+
    '  \"time\": \"2015-07-28T15:15:25.802-07:00\"'+
    '}';
	
	// This test method should give 100% coverage
	static testMethod void testParse() {

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

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBPaymentQueryJSON.Any_Z objAny_Z = new QBPaymentQueryJSON.Any_Z(System.JSON.createParser(json));
		System.assert(objAny_Z != null);
		System.assert(objAny_Z.name == null);
		System.assert(objAny_Z.nil == null);
		System.assert(objAny_Z.value == null);
		System.assert(objAny_Z.declaredType == null);
		System.assert(objAny_Z.scope == null);
		System.assert(objAny_Z.globalScope == null);
		System.assert(objAny_Z.typeSubstituted == null);

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBPaymentQueryJSON.Payment objPayment = new QBPaymentQueryJSON.Payment(System.JSON.createParser(json));
		System.assert(objPayment != null);
		System.assert(objPayment.SyncToken == null);
		System.assert(objPayment.domain == null);
		System.assert(objPayment.DepositToAccountRef == null);
		System.assert(objPayment.UnappliedAmt == null);
		System.assert(objPayment.TxnDate == null);
		System.assert(objPayment.TotalAmt == null);
		System.assert(objPayment.ProcessPayment == null);
		System.assert(objPayment.sparse == null);
		System.assert(objPayment.Line == null);
		System.assert(objPayment.CustomerRef == null);
		System.assert(objPayment.Id == null);
		System.assert(objPayment.MetaData == null);

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBPaymentQueryJSON.Line_Z objLine_Z = new QBPaymentQueryJSON.Line_Z(System.JSON.createParser(json));
		System.assert(objLine_Z != null);
		System.assert(objLine_Z.Amount == null);
		System.assert(objLine_Z.LineEx == null);
		System.assert(objLine_Z.LinkedTxn == null);

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

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

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

		json = '{\"TestAMissingObject\": { \"TestAMissingArray\": [ { \"TestAMissingProperty\": \"Some Value\" } ] } }';
		QBPaymentQueryJSON.LineEx objLineEx = new QBPaymentQueryJSON.LineEx(System.JSON.createParser(json));
		System.assert(objLineEx != null);
		System.assert(objLineEx.any_Z == null);

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

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