public void Should_ReturnExpectedAmounts_When_CalculatingTaxes(List <Product> products, decimal expectedTaxAmount, decimal expectedTotalAmount) { // Arrange var orderInvoiceManager = new OrderInvoiceManager(); var orderInvoice = orderInvoiceManager.CreateInvoice(products); // Act var totalTaxes = orderInvoiceManager.GetTotalTaxes(orderInvoice); var totalAmount = orderInvoiceManager.GetTotalAmount(orderInvoice); // Assert Assert.Equal(expectedTaxAmount, totalTaxes); Assert.Equal(expectedTotalAmount, totalAmount); }
static void Main(string[] args) { Console.WriteLine("INPUT:"); var i = 1; foreach (var productList in InputOrders) { Console.WriteLine(); Console.WriteLine($"Input {i++}:"); foreach (var productString in productList) { Console.WriteLine(productString); } } i = 1; Console.WriteLine(); Console.WriteLine("OUTPUT:"); using (new CultureOverride(CultureInfo.InvariantCulture)) { foreach (var productList in InputOrders) { Console.WriteLine(); Console.WriteLine($"Output {i++}:"); var productParser = new ProductParser(); var orderInvoiceManager = new OrderInvoiceManager(); var orderInvoice = orderInvoiceManager.CreateInvoice(productParser.ParseAll(productList)); foreach (var computedProduct in orderInvoice.Products) { Console.WriteLine(computedProduct); } Console.WriteLine($"Sales Taxes: {orderInvoiceManager.GetTotalTaxes(orderInvoice).ToString("0.00")}"); Console.WriteLine($"Total: {orderInvoiceManager.GetTotalAmount(orderInvoice).ToString("0.00")}"); } Console.WriteLine(); Console.Write("Press any key to exit..."); Console.ReadLine(); } }