Exemplo n.º 1
0
        public void ShouldRetrieveTaxCodeById()
        {
            var taxCodesProxy           = new TaxCodesProxy();
            var taxCodesForFileResponse = taxCodesProxy.GetTaxCodes(null, null, null);

            Assert.True(taxCodesForFileResponse.DataObject.TaxCodes.Count > 0, "No tax codes were retrieved for file.");

            var taxCodeToRetrieveById = taxCodesForFileResponse.DataObject.TaxCodes[0];
            var taxCodeProxy          = new TaxCodeProxy();
            var taxCodeByIdResponse   = taxCodeProxy.GetTaxCode(taxCodeToRetrieveById.Id);

            Assert.NotNull(taxCodeByIdResponse);
            Assert.True(taxCodeByIdResponse.IsSuccessfull, "Request for tax code by Id was not processed successfully.");

            var taxCodeById = taxCodeByIdResponse.DataObject;

            Assert.NotNull(taxCodeById);
            Assert.Equal(taxCodeToRetrieveById.Id, taxCodeById.Id);
            Assert.Equal(taxCodeToRetrieveById.Code, taxCodeById.Code);
            Assert.Equal(taxCodeToRetrieveById.Name, taxCodeById.Name);
            Assert.Equal(taxCodeToRetrieveById.PostingAccountId.GetValueOrDefault(), taxCodeById.PostingAccountId.GetValueOrDefault());
            Assert.Equal(taxCodeToRetrieveById.IsSale, taxCodeById.IsSale);
            Assert.Equal(taxCodeToRetrieveById.IsPurchase, taxCodeById.IsPurchase);
            Assert.Equal(taxCodeToRetrieveById.IsPayroll, taxCodeById.IsPayroll);
            Assert.Equal(taxCodeToRetrieveById.IsActive, taxCodeById.IsActive);
            Assert.Equal(taxCodeToRetrieveById.Rate, taxCodeById.Rate);
            Assert.Equal(taxCodeToRetrieveById.IsShared, taxCodeById.IsShared);
        }
Exemplo n.º 2
0
        private void GetTaxCodes()
        {
            var taxCodeProxy            = new TaxCodesProxy();
            var taxCodesForFileResponse = taxCodeProxy.GetTaxCodes(true, null, null);

            _purchaseTaxCodeId = taxCodesForFileResponse.DataObject.TaxCodes.First(x => x.IsPurchase).Id;
            _salesTaxCodeId    = taxCodesForFileResponse.DataObject.TaxCodes.First(x => x.IsSale).Id;
        }
Exemplo n.º 3
0
        public void ShouldRetrieveTaxCodeListForFile()
        {
            var taxCodeProxy            = new TaxCodesProxy();
            var taxCodesForFileResponse = taxCodeProxy.GetTaxCodes(null, null, null);

            Assert.NotNull(taxCodesForFileResponse);
            Assert.True(taxCodesForFileResponse.IsSuccessfull, "Request for tax codes was not processed successfully.");
            Assert.True(taxCodesForFileResponse.DataObject.TaxCodes.Count > 0, "No tax codes were retrieved for file.");
        }
Exemplo n.º 4
0
        public void ShouldOnlyReturnInactiveTaxCodesForFile()
        {
            var taxCodeProxy            = new TaxCodesProxy();
            var taxCodesForFileResponse = taxCodeProxy.GetTaxCodes(false, null, null);

            Assert.NotNull(taxCodesForFileResponse);
            Assert.True(taxCodesForFileResponse.IsSuccessfull, "Request for tax codes was not processed successfully.");
            Assert.True(taxCodesForFileResponse.DataObject.TaxCodes.Count > 0, "No tax codes were retrieved for file.");
            Assert.True(taxCodesForFileResponse.DataObject.TaxCodes.Find(tc => tc.IsActive) == null, "Only inactive tax codes should have been returned.");
        }