public void Setup() { //Arrange var optionsSqlite = new DbContextOptionsBuilder <AppACContext>() .UseSqlite(@"Data Source=C:\sqlite\AppACDataBaseTest.db") .Options; _dbContext = new AppACContext(optionsSqlite); _dbContext.Database.EnsureDeleted(); _dbContext.Database.EnsureCreated(); _plazoAperturaRepository = new PlazoAperturaRepository(_dbContext); _planAccionRepository = new PlanAccionRepository(_dbContext); _actividadRepository = new ActividadRepository(_dbContext); _crearPlanAccionService = new CrearPlanAccionService( new UnitOfWork(_dbContext), _actividadRepository, _planAccionRepository, _plazoAperturaRepository, new MailServerFake() ); _plazoAperturaService = new PlazoAperturaService( new UnitOfWork(_dbContext), _plazoAperturaRepository, new MailServerFake(), new JefeDptoRepository(_dbContext) ); }
public IActionResult GetAll() { var service = new PlazoAperturaService(_unitOfWork, _plazoAperturaRepository, _mailServer, _jefeDptoRepository); var response = service.GetAll(); return(Ok(response)); }
public IActionResult GetCurrentByJefeDpto(string identificacion) { var service = new PlazoAperturaService(_unitOfWork, _plazoAperturaRepository, _mailServer, _jefeDptoRepository); var response = service.GetCurrentByJefeDpto(identificacion); return(Ok(response)); }
public IActionResult PostCrearPlazoApertura(PlazoAperturaRequest request) { var service = new PlazoAperturaService(_unitOfWork, _plazoAperturaRepository, _mailServer, _jefeDptoRepository); var response = service.CrearPlazoApertura(request); return(Ok(response)); }