public void TestUpdatingSalon() { Mock <IRepository <Salons> > salonRepo = new Mock <IRepository <Salons> >(); Salons salon = new Salons() { SalonId = Guid.NewGuid().ToString(), City = "Sopron", Address = "Zrínyi Miklós u. 32", PostalCode = "9400" }; salonRepo.Setup(repo => repo.Update(It.IsAny <string>(), It.IsAny <Salons>())); SalonsLogic logic = new SalonsLogic(salonRepo.Object); logic.UpdateSalon(salon.SalonId, salon); salonRepo.Verify(repo => repo.Update(salon.SalonId, salon), Times.Once); }
public void UpdateSalon(string salonid, [FromBody] Salons salon) { sLogic.UpdateSalon(salonid, salon); }
public IActionResult EditSalon(Salons s) { salonsLogic.UpdateSalon(s.SalonId, s); return(RedirectToAction(nameof(ListSalons))); }