Esempio n. 1
0
        public void InvoiceTextWithEmptyOrder()
        {
            var testInvoice = new PriceLogic.Invoice.Invoice(123, new List <OrderItem>());

            var expected = "Invoice for order id: 123\nTotal price: 0$";

            Assert.AreEqual(testInvoice.GenerateInvoiceText(), expected);
        }
Esempio n. 2
0
        public void InvoiceHtmlStringWithEmptyOrder()
        {
            var testInvoice = new PriceLogic.Invoice.Invoice(123, new List <OrderItem>());

            var expected = "<table><tr> <td width=100px>Total price: 0$ </td> </tr></table>";

            Assert.AreEqual(testInvoice.GenerateInvoiceHtmlString().Value, expected);
        }
Esempio n. 3
0
        public void InvoiceHtmlStringWithNullOrder()
        {
            var testInvoice = new PriceLogic.Invoice.Invoice(123, null);

            Assert.Throws <NullReferenceException>(() => testInvoice.GenerateInvoiceHtmlString());
        }