Example #1
0
        public void Setup()
        {
            var basicTax = new Tax
            {
                Description = "Basic",
                Rate        = 0.1f
            };

            var importedTax = new Tax
            {
                Description = "Imported",
                Rate        = 0.05f
            };

            bookCategory = new ProductCategory {
                Description = ProductCategoryDescription.Book
            };
            foodCategory = new ProductCategory {
                Description = ProductCategoryDescription.Food
            };
            medicalCategory = new ProductCategory {
                Description = ProductCategoryDescription.Medical
            };
            importedCategory = new ProductCategory {
                Description = ProductCategoryDescription.Imported
            };
            otherCategory = new ProductCategory {
                Description = ProductCategoryDescription.Other
            };

            var bookTaxLiabilities = new TaxLiability {
                Category = bookCategory
            };
            var foodTaxLiabilities = new TaxLiability {
                Category = foodCategory
            };
            var medicalTaxLiabilities = new TaxLiability {
                Category = medicalCategory
            };
            var importedTaxLiabilities = new TaxLiability {
                Category = importedCategory, Taxes = new[] { importedTax }
            };
            var otherTaxLiabilities = new TaxLiability {
                Category = otherCategory, Taxes = new[] { basicTax }
            };

            target = new SalesTaxApplication(bookTaxLiabilities,
                                             foodTaxLiabilities,
                                             medicalTaxLiabilities,
                                             importedTaxLiabilities,
                                             otherTaxLiabilities);
        }
 public async Task UpdateTaxLiability(TaxLiability taxLiability)
 {
     _context.Entry(taxLiability).State = EntityState.Modified;
     await _context.SaveChangesAsync();
 }