public void EditProduct_EqualWithTakedProduct_Test() { editChange.Change(); var expected = editChange.GetT(); Assert.AreEqual(product, expected); }
public IActionResult AddProduct(Product product, IFormFile uploadedFile) { if (uploadedFile != null) { change = new CreateProduct(new ProductInfo(product, uploadedFile, _appEnvironment.WebRootPath)); change.Change(); _unit.GetRepo <Product>().Create(change.GetT()); } else { _unit.GetRepo <Product>().Create(product); } _unit.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult CreateOrder() { if (User.Identity.IsAuthenticated) { if (!(_cart.Lines.Count() == 0)) { var info = new OrderInfo( Guid.Parse(_userManager.GetUserId(User)), _unit.GetRepo <Order>().Get().Count() + 1, _cart); change = new CreateOrder(info); change.Change(); _unit.GetRepo <Order>().Create(change.GetT()); _unit.SaveChanges(); _cart.Clear(); } return(RedirectToAction("Index", "Shop")); } else { return(RedirectToAction("Login", "Account")); } }
public void CreateProduct_NotNull() { createChange.Change(); Assert.IsNotNull(editChange.GetT()); }