private string GetRecieptTotalTaxes(ShoppingBag cart) { Calculation tax = new Calculation(); decimal totalTax = Utility.Truncate(tax.CalculateTotalTax(cart)); decimal totalSales = Utility.Truncate(tax.CalculateTotalSales(cart)); return(string.Format("\tKingdom Taxes: {0}\n\tTotal: {1}\n", totalTax, totalSales)); }
public void CalculateTotalSales_NotImport_NonExempt() { List <Product> products = new List <Product>(); ShoppingBag cart = new ShoppingBag(); products.Add(new Product { ShoppingBagID = 1, ProductName = "stuff", Quantity = 1, Price = 10.00M, IsImport = false, IsExempt = false }); cart.Products = products; RecieptGenerator.Calculation tax = new RecieptGenerator.Calculation(); var result = tax.CalculateTotalSales(cart); Assert.AreEqual(result, 11.00M); }