コード例 #1
0
        public void FillIfEmpty()
        {
            if (_users.GetUsers().Count == 0)
            {
                FillUsers();
            }

            if (_orders.GetAllOrders().Count == 0)
            {
                FillOrders(_users.GetUser(1, true));
                FillOrders2(_users.GetUser(2, true));
            }
        }
コード例 #2
0
        public void PostOrder_after_Authentificate()
        {
            //Arrange
            string productName = "someProd";
            string description = "some details";

            OrderController.ControllerContext = ControllerContextAuthentificator.Authentificate(DefaultUser);

            //Act
            var responce = OrderController.Post(new Order()
            {
                Product = productName, ProductDescription = description
            });

            //Assert
            var order = _orderDirectoryService.GetAllOrders().Single();

            Assert.IsTrue(responce.Value.Product == productName);
            Assert.IsTrue(order.Product == productName);
        }
コード例 #3
0
        public ActionResult <IEnumerable <Order> > GetAll()
        {
            var orders = _orderDirectory.GetAllOrders();

            return(new ActionResult <IEnumerable <Order> >(orders));
        }