Пример #1
0
        public void CompanyVoidAsyncTestsUsingoAuth()
        {
            //Creating the Company for Adding
            Company entity = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, entity);

            Helper.VoidAsync <Company>(qboContextoAuth, added);
        }
Пример #2
0
        public void CompanyAddAsyncTestsUsingoAuth()
        {
            //Creating the Company for Add
            Company entity = QBOHelper.CreateCompany(qboContextoAuth);

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

            QBOHelper.VerifyCompany(entity, added);
        }
Пример #3
0
        public void CompanyFindbyIdTestUsingoAuth()
        {
            //Creating the Company for Adding
            Company company = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, company);
            Company found = Helper.FindById <Company>(qboContextoAuth, added);

            QBOHelper.VerifyCompany(found, added);
        }
Пример #4
0
        public void CompanyAddTestUsingoAuth()
        {
            //Creating the Company for Add
            Company company = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, company);

            //Verify the added Company
            QBOHelper.VerifyCompany(company, added);
        }
Пример #5
0
        public void CompanyUpdateTestUsingoAuth()
        {
            //Creating the Company for Adding
            Company company = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, company);
            //Change the data of added entity
            Company changed = QBOHelper.UpdateCompany(qboContextoAuth, added);
            //Update the returned entity data
            Company updated = Helper.Update <Company>(qboContextoAuth, changed);//Verify the updated Company

            QBOHelper.VerifyCompany(changed, updated);
        }
Пример #6
0
        public void CompanyUpdatedAsyncTestsUsingoAuth()
        {
            //Creating the Company for Adding
            Company entity = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, entity);

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

            //Verify updated Company
            QBOHelper.VerifyCompany(updated, updatedReturned);
        }
Пример #7
0
        public void CompanyVoidTestUsingoAuth()
        {
            //Creating the entity for Adding
            Company entity = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the entity
            Company added = Helper.Add <Company>(qboContextoAuth, entity);

            //Void the returned entity
            try
            {
                Company voided = Helper.Void <Company>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Voided, voided.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
Пример #8
0
        public void CompanyDeleteTestUsingoAuth()
        {
            //Creating the Company for Adding
            Company company = QBOHelper.CreateCompany(qboContextoAuth);
            //Adding the Company
            Company added = Helper.Add <Company>(qboContextoAuth, company);

            //Delete the returned entity
            try
            {
                Company deleted = Helper.Delete <Company>(qboContextoAuth, added);
                Assert.AreEqual(EntityStatusEnum.Deleted, deleted.status);
            }
            catch (IdsException ex)
            {
                Assert.Fail();
            }
        }
Пример #9
0
        public void CompanyBatchUsingoAuth()
        {
            Dictionary <OperationEnum, object> batchEntries = new Dictionary <OperationEnum, object>();

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

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

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

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

            batchEntries.Add(OperationEnum.delete, existing);

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