public void AccessoriesAdd() { Accessory accessory = new Accessory(); accessory.Name = "Jeroen"; accessory.Price = 100; accessory.AnimalName = "Aap"; var result = accessoriesController.Create(accessory) as RedirectToRouteResult; Assert.AreEqual("Index", result.RouteValues["Action"]); Assert.IsNotNull(result.ToString()); AccessoryRepo.Remove(accessory.Id); }
public void IsRepositoryAddsAccessory() { var count = AccessoryRepo.GetAccesories().Count() + 1; Accessory accessory = new Accessory(); { accessory.Name = "Peper"; accessory.Price = 15; } AccessoryRepo.Add(accessory); var result = AccessoryRepo.GetAccesories(); var numberOfRecords = result.ToList().Count; Assert.AreEqual(count, numberOfRecords); AccessoryRepo.Remove(accessory.Id); }
public ActionResult DeleteConfirmed(int id) { dbAccessory.Remove(id); return(RedirectToAction("Index")); }