コード例 #1
0
        public void JournalCodeAddAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the JournalCode for Add
            JournalCode entity = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);

            JournalCode added = Helper.AddAsync <JournalCode>(qboContextoAuth, entity);
        }
コード例 #2
0
 public void JournalCodeFindbyIdTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the JournalCode for Adding
     JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
     //Adding the journalCode
     JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);
     JournalCode found = Helper.FindById <JournalCode>(qboContextoAuth, added);
 }
コード例 #3
0
        public void AddOthersJournalCodeTestUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the JournalCode for Add
            JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Others);

            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);
        }
コード例 #4
0
        [Ignore] //IgnoreReason: Not supported
        public void JournalCodeVoidAsyncTestsUsingoAuth()
        {
            //Creating the JournalCode for Adding
            JournalCode entity = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, entity);

            Helper.VoidAsync <JournalCode>(qboContextoAuth, added);
        }
コード例 #5
0
        public void JournalCodeQueryUsingoAuth()
        {
            QueryService <JournalCode> entityQuery = new QueryService <JournalCode>(qboContextoAuth);
            JournalCode        existing            = Helper.FindOrAdd <JournalCode>(qboContextoAuth, new JournalCode());
            List <JournalCode> entities            = entityQuery.ExecuteIdsQuery("SELECT * FROM JournalCode where Id='" + existing.Id + "'").ToList <JournalCode>();

            //List<JournalCode> entities = entityQuery.Where(c => c.Id == existing.Id).ToList();
            Assert.IsTrue(entities.Count() > 0);
        }
コード例 #6
0
        public void JournalCodeFindByIdAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the JournalCode for Adding
            JournalCode entity = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, entity);

            //FindById and verify
            Helper.FindByIdAsync <JournalCode>(qboContextoAuth, added);
        }
コード例 #7
0
        public void AddWagesJournalCodeTestUsingoAuth()
        {
            //Creating the JournalCode for Add
            JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Wages);

            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);

            //Verify the added Account
            QBOHelper.VerifyJournalCode(journalCode, added);
        }
コード例 #8
0
 public void JournalCodeSparseUpdateTestUsingoAuth(ServiceContext qboContextoAuth)
 {
     //Creating the JournalCode for Adding
     JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
     //Adding the JournalCode
     JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);
     //Change the data of added entity
     JournalCode changed = QBOHelper.UpdateJournalCodeSparse(qboContextoAuth, added.Id, added.SyncToken);
     //Update the returned entity data
     JournalCode updated = Helper.Update <JournalCode>(qboContextoAuth, changed);//Verify the updated JournalCode
 }
コード例 #9
0
        public void JournalCodeUpdatedAsyncTestsUsingoAuth(ServiceContext qboContextoAuth)
        {
            //Creating the JournalCode for Adding
            JournalCode entity = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, entity);

            //Update the JournalCode
            JournalCode updated = QBOHelper.UpdateJournalCode(qboContextoAuth, added);
            //Call the service
            JournalCode updatedReturned = Helper.UpdateAsync <JournalCode>(qboContextoAuth, updated);
        }
コード例 #10
0
        public void JournalCodeUpdateTestUsingoAuth()
        {
            //Creating the JournalCode for Adding
            JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);
            //Change the data of added entity
            JournalCode changed = QBOHelper.UpdateJournalCode(qboContextoAuth, added);
            //Update the returned entity data
            JournalCode updated = Helper.Update <JournalCode>(qboContextoAuth, changed);//Verify the updated JournalCode

            QBOHelper.VerifyJournalCode(changed, updated);
        }
コード例 #11
0
        //check
        #endregion



        #region  Batch


        public void JournalCodeBatchUsingoAuth(ServiceContext qboContextoAuth)
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

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

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses));

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

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



            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.Batch <JournalCode>(qboContextoAuth, batchEntries);
        }
コード例 #12
0
        [Ignore] //IgnoreReason: Not supported
        public void JournalCodeVoidTestUsingoAuth()
        {
            //Creating the entity for Adding
            JournalCode entity = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the entity
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, entity);

            //Void the returned entity
            try
            {
                JournalCode voided = Helper.Void <JournalCode>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
コード例 #13
0
        [Ignore] //IgnoreReason: Not supported
        public void JournalCodeDeleteTestUsingoAuth()
        {
            //Creating the JournalCode for Adding
            JournalCode journalCode = QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses);
            //Adding the JournalCode
            JournalCode added = Helper.Add <JournalCode>(qboContextoAuth, journalCode);

            //Delete the returned entity
            try
            {
                JournalCode deleted = Helper.Delete <JournalCode>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Deleted, deleted.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
コード例 #14
0
        public void JournalCodeBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

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

            batchEntries.Add(OperationEnum.create, QBOHelper.CreateJournalCode(qboContextoAuth, JournalCodeTypeEnum.Expenses));

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

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



            ReadOnlyCollection <IntuitBatchResponse> batchResponses = Helper.BatchTest <JournalCode>(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 JournalCode).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++;
            }
        }
コード例 #15
0
 public void JournalCodeQueryUsingoAuth(ServiceContext qboContextoAuth)
 {
     QueryService <JournalCode> entityQuery = new QueryService <JournalCode>(qboContextoAuth);
     JournalCode        existing            = Helper.FindOrAdd <JournalCode>(qboContextoAuth, new JournalCode());
     List <JournalCode> jc = entityQuery.ExecuteIdsQuery("SELECT * FROM JournalCode where Id='" + existing.Id + "'").ToList <JournalCode>();
 }