示例#1
0
        public void Edit_WhenProductDoesNotExist_ReturnNotFound()
        {
            Product obj        = null;
            var     unitOfWork = new Mock <IUnitOfWork>();

            unitOfWork.Setup(i => i.ProductRepo.GetProductById(It.IsAny <int>())).Returns(obj);

            var controller = new DummyController(unitOfWork.Object);

            controller.Edit(1).Should().BeOfType(typeof(HttpNotFoundResult));
        }