Exemple #1
0
        static void Main(string[] args)
        {
            Order o = new Order();

            o.AddItem(SalesItemFactory.GetSalesItem("book", 12.49M));
            o.AddItem(SalesItemFactory.GetSalesItem("CD", 14.99M, ItemType.Basic));
            o.AddItem(SalesItemFactory.GetSalesItem("chocolate bar", 0.85M));
            Console.WriteLine("Order 1:");
            Console.WriteLine("Order Price: " + o.GetOrderPrice());
            Console.WriteLine("Order Tax: " + o.GetOrderSalesTax());
            Console.WriteLine("Order Total: " + o.GetOrderTotal());

            o = new Order();

            o.AddItem(SalesItemFactory.GetSalesItem("imported chocolates", 10.0M, ItemType.Import));
            o.AddItem(SalesItemFactory.GetSalesItem("imported perfume", 47.5M, ItemType.Basic | ItemType.Import));
            Console.WriteLine("Order 2:");
            Console.WriteLine("Order Price: " + o.GetOrderPrice());
            Console.WriteLine("Order Tax: " + o.GetOrderSalesTax());
            Console.WriteLine("Order Total: " + o.GetOrderTotal());

            o = new Order();

            o.AddItem(SalesItemFactory.GetSalesItem("imported perfume", 27.99M, ItemType.Basic | ItemType.Import));
            o.AddItem(SalesItemFactory.GetSalesItem("perfume", 18.99M, ItemType.Basic));
            o.AddItem(SalesItemFactory.GetSalesItem("pills", 9.75M));
            o.AddItem(SalesItemFactory.GetSalesItem("imported chocolates", 11.25M, ItemType.Import));
            Console.WriteLine("Order 3:");
            Console.WriteLine("Order Price: " + o.GetOrderPrice());
            Console.WriteLine("Order Tax: " + o.GetOrderSalesTax());
            Console.WriteLine("Order Total: " + o.GetOrderTotal());

            Console.ReadLine();
        }
 public StandardItemTests()
 {
     _item      = TestItems.StandardItem;
     _salesItem = SalesItemFactory.Create(_item);
 }
Exemple #3
0
 public DeadlinedItemTests()
 {
     _item      = TestItems.DeadlinedItem;
     _salesItem = SalesItemFactory.Create(_item);
 }
 //SellIn = 0, Quality = 80
 public LegendaryItemTests()
 {
     _item      = TestItems.LegendaryItem;
     _salesItem = SalesItemFactory.Create(_item);
 }
 public MaturingItemTests()
 {
     _item      = TestItems.MaturingItem;
     _salesItem = SalesItemFactory.Create(_item);
 }
 public ConjuredItemTests()
 {
     _item      = TestItems.ConjuredItem;
     _salesItem = SalesItemFactory.Create(_item);
 }