public ManagersController(
     IManagersService managersService,
     IFightersService fightersServie,
     IUsersService usersService,
     UserManager <ApplicationUser> userManager)
 {
     this.managersService = managersService;
     this.fightersService = fightersServie;
     this.usersService    = usersService;
     this.userManager     = userManager;
 }
Ejemplo n.º 2
0
 public CutmenController(
     ICutmenService cutmenService,
     IFightersService fightersService,
     IUsersService usersService,
     UserManager <ApplicationUser> userManager)
 {
     this.cutmenService   = cutmenService;
     this.fightersService = fightersService;
     this.usersService    = usersService;
     this.userManager     = userManager;
 }
 public CoachesController(
     ICoachesService coachesService,
     IFightersService fightersService,
     IUsersService usersService,
     UserManager <ApplicationUser> userManager)
 {
     this.coachesService  = coachesService;
     this.fightersService = fightersService;
     this.usersService    = usersService;
     this.userManager     = userManager;
 }
 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 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();
            }
        }
Ejemplo n.º 7
0
 public HomeController(IFightersService fightersService)
 {
     this.fightersService = fightersService;
 }