Пример #1
0
        public void UpdateItemStockValid()
        {
            var SessionMock = new TestControllerBuilder();
            var controller = new ItemController(new ItemBLL(new ItemServiceStub()));
            SessionMock.InitializeController(controller);

            var actionResult = (RedirectToRouteResult)controller.UpdateItemStock(1, 10);

            Assert.AreEqual(actionResult.RouteName, "");
            Assert.AreEqual(controller.Session["MsgType"], "SUCCESS");
        }
Пример #2
0
        public void UpdateItemStockReturnNullObject()
        {
            var SessionMock = new TestControllerBuilder();
            var controller = new ItemController(new ItemBLL(new ItemServiceStub()));
            SessionMock.InitializeController(controller);

            var actionResult = (HttpNotFoundResult)controller.UpdateItemStock(99, 10);

            Assert.AreEqual(actionResult.StatusCode, 404);
        }