Ejemplo n.º 1
0
 public void ExecuteAction()
 {
     if (_cmd == ProductCommandList.Increase)
     {
         _productManager.IncreaseCostPerunit(_amt);
     }
     else
     {
         _productManager.DecreasedCostPerunit(_amt);
     }
 }
Ejemplo n.º 2
0
        static void BasicProduct()
        {
            var prod = new Product
            {
                Name        = "My Product",
                Description = "My product Description",
                CostPerUnit = 0.10,
                WeightUnit  = 1,
                Weight      = "Heavy"
            };

            var pManager = new ProductManager(prod);

            pManager.IncreaseCostPerunit(43);
            pManager.DecreasedCostPerunit(42);
            // WIll match the changes wrought with the reciever.
            Console.WriteLine(prod);
        }