public HomeController(CarsLogic carsLogic, SalonsLogic salonsLogic, RentersLogic rentersLogic, StatsLogic statsLogic) { this.carsLogic = carsLogic; this.salonsLogic = salonsLogic; this.rentersLogic = rentersLogic; this.statsLogic = statsLogic; }
public void TestAddSalon() { Mock <IRepository <Salons> > salonRepo = new Mock <IRepository <Salons> >(); Salons salon = new Salons() { City = "Budapest", PostalCode = "1132", Address = "Nemtudom utca 12." }; salonRepo.Setup(repo => repo.Insert(It.IsAny <Salons>())); SalonsLogic logic = new SalonsLogic(salonRepo.Object); logic.InsertSalon(salon); salonRepo.Verify(repo => repo.Insert(salon), Times.Once); }
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 SalonsController(SalonsLogic sLogic) { this.sLogic = sLogic; }
public OtherController(SalonsLogic sLogic, CarsLogic cLogic, RentersLogic rLogic) { this.sLogic = sLogic; this.cLogic = cLogic; this.rLogic = rLogic; }