public FightersService( IDeletableEntityRepository <Fighter> fightersRepository, IDeletableEntityRepository <Record> recordsRepository, IDeletableEntityRepository <Fight> fightsRepository, IDeletableEntityRepository <ApplicationUser> usersRepository, IBiographiesService biographiesService, ISkillsService skillService) { this.fightersRepository = fightersRepository; this.recordsRepository = recordsRepository; this.fightsRepository = fightsRepository; this.biographiesService = biographiesService; this.usersRepository = usersRepository; this.skillsService = skillService; }
public FightersController( IFightersService fightersService, ICategoriesService categoriesService, IBiographiesService biographiesService, ISkillsService skillsService, IOrganizationsService organizationsService, IUsersService usersService, IRecordsService recordsService, UserManager <ApplicationUser> userManager) { this.fightersService = fightersService; this.categoriesService = categoriesService; this.biographiesService = biographiesService; this.skillsService = skillsService; this.organizationsService = organizationsService; this.usersService = usersService; this.recordsService = recordsService; this.userManager = userManager; }
public UsersController( IUsersService usersService, UserManager <ApplicationUser> userManager, IFightersService fightersService, ISkillsService skillsService, IBiographiesService biographiesService, IManagersService managersService, ICoachesService coachesService, ICutmenService cutmenService) { this.usersService = usersService; this.userManager = userManager; this.fightersService = fightersService; this.skillsService = skillsService; this.biographiesService = biographiesService; this.managersService = managersService; this.coachesService = coachesService; this.cutmenService = cutmenService; }
public BiogrpahiesServiceTests() { DbContextOptionsBuilder <ApplicationDbContext> options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); Account account = new Account("Cloudinary", "Test", "Account"); Cloudinary cloudinary = new Cloudinary(account); this.applicationDbContext = new ApplicationDbContext(options.Options); this.biographiesRepository = new EfDeletableEntityRepository <Biography>(this.applicationDbContext); this.cloudinaryService = new CloudinaryService(cloudinary); this.biographiesService = new BiogrpahiesService(this.biographiesRepository, this.cloudinaryService); foreach (var biography in this.GetTestBiographies()) { this.biographiesRepository.AddAsync(biography); this.biographiesRepository.SaveChangesAsync(); } }
public FightersServiceTests() { DbContextOptionsBuilder <ApplicationDbContext> options = new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()); Account account = new Account("Cloudinary", "Test", "Account"); Cloudinary cloudinary = new Cloudinary(account); AutoMapperConfig.RegisterMappings(typeof(FightersDropDownViewModel).Assembly); this.applicationDbContext = new ApplicationDbContext(options.Options); this.fightersRepository = new EfDeletableEntityRepository <Fighter>(this.applicationDbContext); this.usersRepository = new EfDeletableEntityRepository <ApplicationUser>(this.applicationDbContext); this.fightsRepository = new EfDeletableEntityRepository <Fight>(this.applicationDbContext); this.recordsRepository = new EfDeletableEntityRepository <PugnaFighting.Data.Models.Record>(this.applicationDbContext); this.biographiesRepository = new EfDeletableEntityRepository <Biography>(this.applicationDbContext); this.skillsRepository = new EfDeletableEntityRepository <Skill>(this.applicationDbContext); this.organizationsRepository = new EfDeletableEntityRepository <Organization>(this.applicationDbContext); this.cloudinaryService = new CloudinaryService(cloudinary); this.biographiesService = new BiogrpahiesService(this.biographiesRepository, this.cloudinaryService); this.skillsService = new SkillsService(this.skillsRepository, this.usersRepository); this.fightersService = new FightersService( this.fightersRepository, this.recordsRepository, this.fightsRepository, this.usersRepository, this.biographiesService, this.skillsService); var user = new ApplicationUser() { Id = "51926c23-8a91-4e7e-94be-a97dd84bad1d", Coins = 10000, UserName = "******", FightersCount = 3, }; this.usersRepository.AddAsync(user); this.usersRepository.SaveChangesAsync(); foreach (var fighter in this.GetTestFighters()) { this.fightersRepository.AddAsync(fighter); this.fightersRepository.SaveChangesAsync(); } foreach (var skill in this.GetTestSkills()) { this.skillsRepository.AddAsync(skill); this.skillsRepository.SaveChangesAsync(); } foreach (var record in this.GetTestRecords()) { this.recordsRepository.AddAsync(record); this.recordsRepository.SaveChangesAsync(); } foreach (var biography in this.GetTestBiographies()) { this.biographiesRepository.AddAsync(biography); this.biographiesRepository.SaveChangesAsync(); } foreach (var organization in this.GetTestOrganizations()) { this.organizationsRepository.AddAsync(organization); this.organizationsRepository.SaveChangesAsync(); } }