Beispiel #1
0
 public void AttachableFindByIdAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Attachable for Adding
     Attachable entity = QBOHelper.CreateAttachable(qboContextoAuth);
     //Adding the Attachable
     Attachable added = Helper.Add <Attachable>(qboContextoAuth, entity);
 }
Beispiel #2
0
 public void AttachableFindbyIdTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Attachable for Adding
     Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
     //Adding the Attachable
     Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);
     Attachable found = Helper.FindById <Attachable>(qboContextoAuth, added);
 }
Beispiel #3
0
 //This attachable endpoint is used to add a note
 public void AttachableAddTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Attachable for Add
     Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
     //Adding the Attachable
     Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);
     //Verify the added Attachable
 }
Beispiel #4
0
        public void AttachableVoidAsyncTestsUsingoAuth()
        {
            //Creating the Attachable for Adding
            Attachable entity = QBOHelper.CreateAttachable(qboContextoAuth);
            //Adding the Attachable
            Attachable added = Helper.Add <Attachable>(qboContextoAuth, entity);

            Helper.VoidAsync <Attachable>(qboContextoAuth, added);
        }
Beispiel #5
0
        public void AttachableAddAsyncTestsUsingoAuth()
        {
            //Creating the Attachable for Add
            Attachable entity = QBOHelper.CreateAttachable(qboContextoAuth);

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

            QBOHelper.VerifyAttachable(entity, added);
        }
Beispiel #6
0
 public void AttachableUpdateTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the Attachable for Adding
     Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
     //Adding the Attachable
     Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);
     //Change the data of added entity
     Attachable changed = QBOHelper.UpdateAttachable(qboContextoAuth, added);
     //Update the returned entity data
     Attachable updated = Helper.Update <Attachable>(qboContextoAuth, changed);//Verify the updated Attachable
 }
Beispiel #7
0
        public void AttachableUpdatedAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Attachable for Adding
            Attachable entity = QBOHelper.CreateAttachable(qboContextoAuth);
            //Adding the Attachable
            Attachable added = Helper.Add <Attachable>(qboContextoAuth, entity);

            //Update the Attachable
            Attachable updated = QBOHelper.UpdateAttachable(qboContextoAuth, added);
            //Call the service
            Attachable updatedReturned = Helper.UpdateAsync <Attachable>(qboContextoAuth, updated);
        }
Beispiel #8
0
        public void AttachableSparseUpdateTestUsingoAuth()
        {
            //Creating the Attachable for Adding
            Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
            //Adding the Attachable
            Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);
            //Change the data of added entity
            Attachable changed = QBOHelper.SparseUpdateAttachable(qboContextoAuth, added.Id, added.SyncToken);
            //Update the returned entity data
            Attachable updated = Helper.Update <Attachable>(qboContextoAuth, changed);//Verify the updated Attachable

            QBOHelper.VerifyAttachableSparseUpdate(changed, updated);
        }
Beispiel #9
0
        public void AttachableBatchUsingoAuth(ServiceContext qboContextoAuth)
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

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

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

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

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

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.Batch <Attachable>(qboContextoAuth, batchEntries);
        }
Beispiel #10
0
        public void AttachableDeleteTestUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the Attachable for Adding
            Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
            //Adding the Attachable
            Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);

            //Delete the returned entity
            try
            {
                Attachable deleted = Helper.Delete <Attachable>(qboContextoAuth, added);
            }
            catch (IdsException ex)
            {
            }
        }
Beispiel #11
0
        public void AttachableVoidTestUsingoAuth()
        {
            //Creating the Attachable for Adding
            Attachable attachable = QBOHelper.CreateAttachable(qboContextoAuth);
            //Adding the Attachable
            Attachable added = Helper.Add <Attachable>(qboContextoAuth, attachable);

            //Delete the returned entity
            try
            {
                Attachable voided = Helper.Void <Attachable>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
Beispiel #12
0
        public void AttachableBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

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

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

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

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

            batchEntries.Add(OperationEnum.delete, existing);

            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.BatchTest <Attachable>(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 Attachable).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++;
            }
        }