Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Invoice cust1 = new Invoice("Jorma");
            cust1.InvoiceAdd(new InvoiceItem("Milk", 1.75, 1));
            cust1.InvoiceAdd(new InvoiceItem("Beer", 5.25, 1));
            cust1.InvoiceAdd(new InvoiceItem("Butter", 2.50, 2));

            Console.WriteLine(cust1.PrintInvoice());
        }
Ejemplo n.º 2
0
        public void TotalTest()
        {
            //arrange
            Invoice inv = new Invoice("asd");
            inv.InvoiceAdd(new InvoiceItem("Milk", 1.75, 1));
            inv.InvoiceAdd(new InvoiceItem("Beer", 5.25, 1));
            double expected = 7;


            //act
            double actual = inv.Total();

            //assert
            Assert.AreEqual(expected,actual);
        }