public void BillAddAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Bill for Add
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);

            Bill added = Helper.AddAsync <Bill>(qboContextoAuth, entity);
        }
 public void BillAddTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Bill for Add
     Bill bill = QBOHelper.CreateBill(qboContextoAuth);
     //Adding the Bill
     Bill added = Helper.Add <Bill>(qboContextoAuth, bill);
 }
 public void BillFindbyIdTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Bill for Adding
     Bill bill = QBOHelper.CreateBill(qboContextoAuth);
     //Adding the Bill
     Bill added = Helper.Add <Bill>(qboContextoAuth, bill);
     Bill found = Helper.FindById <Bill>(qboContextoAuth, added);
 }
示例#4
0
        public void BillVoidAsyncTestsUsingoAuth()
        {
            //Creating the Bill for Adding
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, entity);

            Helper.VoidAsync <Bill>(qboContextoAuth, added);
        }
示例#5
0
        public void BillAddAsyncTestsUsingoAuth()
        {
            //Creating the Bill for Add
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);

            Bill added = Helper.AddAsync <Bill>(qboContextoAuth, entity);

            QBOHelper.VerifyBill(entity, added);
        }
        public void BillFindByIdAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Bill for Adding
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, entity);

            //FindById and verify
            Helper.FindByIdAsync <Bill>(qboContextoAuth, added);
        }
示例#7
0
        public void BillAddTestUsingoAuth()
        {
            //Creating the Bill for Add
            Bill bill = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, bill);

            //Verify the added Bill
            QBOHelper.VerifyBill(bill, added);
        }
 public void BillSparseUpdateTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Bill for Adding
     Bill bill = QBOHelper.CreateBill(qboContextoAuth);
     //Adding the Bill
     Bill added = Helper.Add <Bill>(qboContextoAuth, bill);
     //Change the data of added entity
     Bill changed = QBOHelper.UpdateBillSparse(qboContextoAuth, added.Id, added.SyncToken);
     //Update the returned entity data
     Bill updated = Helper.Update <Bill>(qboContextoAuth, changed);//Verify the updated Bill
 }
        public void BillSparseUpdatedAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Bill for Adding
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, entity);

            //Update the Bill
            Bill updated = QBOHelper.UpdateBillSparse(qboContextoAuth, added.Id, added.SyncToken);
            //Call the service
            Bill updatedReturned = Helper.UpdateAsync <Bill>(qboContextoAuth, updated);
        }
示例#10
0
        public void BillUpdateTestUsingoAuth()
        {
            //Creating the Bill for Adding
            Bill bill = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, bill);
            //Change the data of added entity
            Bill changed = QBOHelper.UpdateBill(qboContextoAuth, added);
            //Update the returned entity data
            Bill updated = Helper.Update <Bill>(qboContextoAuth, changed);//Verify the updated Bill

            QBOHelper.VerifyBill(changed, updated);
        }
示例#11
0
        public void BillUpdatedAsyncTestsUsingoAuth()
        {
            //Creating the Bill for Adding
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, entity);

            //Update the Bill
            Bill updated = QBOHelper.UpdateBill(qboContextoAuth, added);
            //Call the service
            Bill updatedReturned = Helper.UpdateAsync <Bill>(qboContextoAuth, updated);

            //Verify updated Bill
            QBOHelper.VerifyBill(updated, updatedReturned);
        }
        public void BillDeleteTestUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Bill for Adding
            Bill bill = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, bill);

            //Delete the returned entity
            try
            {
                Bill deleted = Helper.Delete <Bill>(qboContextoAuth, added);
            }
            catch (IdsException ex)
            {
            }
        }
        public void BillBatchUsingoAuth(ServiceContext qboContextoAuth)
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

            Bill existing = Helper.FindOrAdd(qboContextoAuth, new Bill());

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateBill(qboContextoAuth));

            batchEntries.Add(OperationEnum.update, QBOHelper.UpdateBill(qboContextoAuth, existing));

            batchEntries.Add(OperationEnum.query, "select * from Bill");

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.Batch <Bill>(qboContextoAuth, batchEntries);
        }
示例#14
0
        public void BillVoidTestUsingoAuth()
        {
            //Creating the entity for Adding
            Bill entity = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the entity
            Bill added = Helper.Add <Bill>(qboContextoAuth, entity);

            //Void the returned entity
            try
            {
                Bill voided = Helper.Void <Bill>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
示例#15
0
        public void BillDeleteTestUsingoAuth()
        {
            //Creating the Bill for Adding
            Bill bill = QBOHelper.CreateBill(qboContextoAuth);
            //Adding the Bill
            Bill added = Helper.Add <Bill>(qboContextoAuth, bill);

            //Delete the returned entity
            try
            {
                Bill deleted = Helper.Delete <Bill>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Deleted, deleted.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
示例#16
0
        public void BillBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

            Bill existing = Helper.FindOrAdd(qboContextoAuth, new Bill());

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateBill(qboContextoAuth));

            batchEntries.Add(OperationEnum.update, QBOHelper.UpdateBill(qboContextoAuth, existing));

            batchEntries.Add(OperationEnum.query, "select * from Bill");

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.BatchTest <Bill>(qboContextoAuth, batchEntries);

            int position = 0;

            foreach (IntuitBatchResponse resp in batchResponses)
            {
                if (resp.ResponseType == ResponseType.Exception)
                {
                    Assert.Fail(resp.Exception.ToString());
                }

                if (resp.ResponseType == ResponseType.Entity)
                {
                    Assert.IsFalse(string.IsNullOrEmpty((resp.Entity as Bill).Id));
                }
                else if (resp.ResponseType == ResponseType.Query)
                {
                    Assert.IsTrue(resp.Entities != null && resp.Entities.Count > 0);
                }
                else if (resp.ResponseType == ResponseType.CdcQuery)
                {
                    Assert.IsTrue(resp.CDCResponse != null && resp.CDCResponse.entities != null && resp.CDCResponse.entities.Count > 0);
                }

                position++;
            }
        }