Example #1
0
        public static void Question3Solution()
        {
            List <Product> products = new List <Product>();

            Random random = new Random();

            for (int i = 0; i < 100; i++)
            {
                products.Add(new Product()
                {
                    Id    = Guid.NewGuid(),
                    Price = random.NextDouble() * random.Next(1, 100)
                });
            }

            ILocalizationInfo us = new Us();
            ILocalizationInfo ca = new Canada();

            ICartTotal cart = new CartTotal();

            Console.WriteLine("US: " + cart.Calculate(products, us));
            Console.WriteLine("CA: " + cart.Calculate(products, ca));
        }
Example #2
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Canada obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #3
0
 public Canada(Canada.Market m) : this(NQuantLibcPINVOKE.new_Canada__SWIG_0((int)m), true) {
   if (NQuantLibcPINVOKE.SWIGPendingException.Pending) throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
 }
Example #4
0
 public static int GetMarketId(this Canada value)
 {
     return((int)value);
 }
Example #5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Canada obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }