public void GetAll() { var refactorMeProvider = new RefactorMeProvider(); var controller = new ProductsController(refactorMeProvider); var addedproduct = controller.GetProduct(_Product.Id).Result; Assert.AreEqual(addedproduct.Id, _Product.Id); }
public void Delete() { var refactorMeProvider = new RefactorMeProvider(); var controller = new ProductsController(refactorMeProvider); controller.Delete(_Product.Id); var deletedProduct = controller.GetProduct(_Product.Id).Result; Assert.AreEqual(deletedProduct, null); }
public void Update() { var refactorMeProvider = new RefactorMeProvider(); var controller = new ProductsController(refactorMeProvider); _Product.Name = "Samsung Galaxy S8"; controller.Update(_Product); var updatedProduct = controller.GetProduct(_Product.Id).Result; Assert.AreEqual(updatedProduct.Name, "Samsung Galaxy S8 Test"); }
public void Product() { var refactorMeProvider = new RefactorMeProvider(); var controller = new ProductsController(refactorMeProvider); //Adding A Product to DB var product = controller.Create(new ProductDTO { Name = "Samsung Galaxy S7", Description = "Newest mobile product from Samsung.", Price = 1024.99m, DeliveryPrice = 16.99m, }); // _Product = (ProductDTO)product; GetAll(); Update(); Delete(); }
public void Add() { IRefactorMeProvider repo = new RefactorMeProvider(); var productToInsert = new Product { DeliveryPrice = 255, Description = "S10", Name = "Samsung", Price = 234 }; repo.Products.Add(productToInsert); var productToEdit = repo.Products.GetEntityAsync(e => e.Id == productToInsert.Id).Result; productToEdit.Price = 258; repo.Products.Edit(productToEdit); repo.Products.Delete(productToEdit.Id); var response = repo.Products.Any(product => product.Id == productToEdit.Id); }
public void GetAll() { IRefactorMeProvider repo = new RefactorMeProvider(); var product = repo.Products.GetAllAsync(); }
public void GetEntities() { IRefactorMeProvider repo = new RefactorMeProvider(); }