public void Setup() { cursoIdTest = new Guid("2ce24c4d-df93-4620-ba47-c8065633775f"); var fixture = new Fixture(); var cursoRecords = fixture.CreateMany <Curso>().ToList(); cursoRecords.Add(fixture.Build <Curso>().With(tr => tr.CursoId, cursoIdTest).Create()); var options = new DbContextOptionsBuilder <EducationDbContext>() .UseInMemoryDatabase(databaseName: $"EducationDbContext-{Guid.NewGuid()}") .Options; var educationDbContextFake = new EducationDbContext(options); educationDbContextFake.Cursos.AddRange(cursoRecords); educationDbContextFake.SaveChanges(); var mapConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingTest()); }); var mapper = mapConfig.CreateMapper(); handlerByIdCurso = new GetCursoByIdQuery.GetCursoByIdQueryHandler(educationDbContextFake, mapper); }
public void Setup() { var fixture = new Fixture(); var cursoRecords = fixture.CreateMany <Curso>().ToList(); cursoRecords.Add(fixture.Build <Curso>().With(tr => tr.CursoId, Guid.Empty).Create()); var options = new DbContextOptionsBuilder <EducationDbContext>() .UseInMemoryDatabase(databaseName: $"EducationDbContext-{Guid.NewGuid()}") .Options; var educationDbContextFake = new EducationDbContext(options); educationDbContextFake.Cursos.AddRange(cursoRecords); educationDbContextFake.SaveChanges(); var mapConfig = new MapperConfiguration(cfg => { cfg.AddProfile(new MappingTest()); }); var mapper = mapConfig.CreateMapper(); handlerCursoCreate = new CreateCursoCommand.CreatecursoCommandHandler(educationDbContextFake); }
public EducationService(EducationDbContext db, IUnitOfWork uow) : base(db, uow) { }
public ProjectsController(EducationDbContext context, IWebHostEnvironment hostEnvironment) { _context = context; webHostEnvironment = hostEnvironment; }
public BaseService(EducationDbContext context, IUnitOfWork uow) { _dbContext = context; _uow = uow; _dbSet = _dbContext.Set <T>(); }
public UnitOfWork(EducationDbContext dbContext) { _dbContext = dbContext; }
public ProjectsController(EducationDbContext context) { _context = context; }
public UserService(EducationDbContext db, IUnitOfWork uow, UserManager <User> userManager, RoleManager <Role> roleManager) : base(db, uow) { _userManager = userManager; _roleManager = roleManager; }
public GetCursoByIdQueryHandler(EducationDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public MajorsController(EducationDbContext context) { _context = context; }
public TasksController(EducationDbContext context) { _context = context; }
public CreatecursoCommandHandler(EducationDbContext context) { _context = context; }