Esempio n. 1
0
        public ActionResult Index(Order order, string action)
        {
            if (ModelState.IsValid)
            {
                lock (dblock)
                {
                    order.Type         = action == "Buy" ? OrderType.Buy : OrderType.Sell;
                    order.AdditionTime = DateTime.Now;
                    orderHundler.HundleNewOrder(order);
                }
            }

            return(View());
        }
Esempio n. 2
0
        public void AddNewOrder(OrderType orderType)
        {
            var order = new Order(1, 1.0f, 1, "*****@*****.**", orderType, DateTime.Now);

            hundler.HundleNewOrder(order);

            Assert.Contains(order, context.Orders.ToList());
            Assert.AreEqual(1, context.Orders.Count());
        }