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();
            }
        }
 public CountriesController(ICountriesService countriesService, ICloudinaryService cloudinaryService)
 {
     this.countriesService  = countriesService;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 3
0
 public ProductsController(IProductService productsService, ICloudinaryService cloudinaryService, ICategoryService categoriesService)
 {
     this.productsService   = productsService;
     this.cloudinaryService = cloudinaryService;
     this.categoriesService = categoriesService;
 }
Ejemplo n.º 4
0
 public EventsController(IEventsService eventsService, ICloudinaryService cloudinaryService)
 {
     this.eventsService     = eventsService;
     this.cloudinaryService = cloudinaryService;
 }
 public BannerController(IBannerService bannerService, ICloudinaryService cloudinaryService)
 {
     _bannerService     = bannerService;
     _cloudinaryService = cloudinaryService;
 }
 public PlayersController(IPlayersService playersService, ICloudinaryService cloudinaryService, IMapper mapper)
 {
     this.playersService    = playersService;
     this.cloudinaryService = cloudinaryService;
     this.mapper            = mapper;
 }
Ejemplo n.º 7
0
 public PlayerController(IFootballPlayerService footballPlayerService, ICloudinaryService cloudinaryService)
 {
     this.footballPlayerService = footballPlayerService;
     this.cloudinaryService     = cloudinaryService;
 }
Ejemplo n.º 8
0
 public CarsController(ICarService carService, IModelCarService modelCarService, IMakeCarService makeCarService, IBodyCarService bodyCarService, ApplicationDbContext db, Cloudinary cloudinary, ICloudinaryService cloudinaryService, IFeatureService featureService, UserManager <ApplicationUser> userManager, IEngineService engineService)
 {
     this.carService      = carService;
     this.modelCarService = modelCarService;
     this.makeCarService  = makeCarService;
     this.bodyCarService  = bodyCarService;
     this.db                = db;
     this.cloudinary        = cloudinary;
     this.cloudinaryService = cloudinaryService;
     this.featureService    = featureService;
     this.userManager       = userManager;
     this.engineService     = engineService;
 }
Ejemplo n.º 9
0
 public ProductsController(IProductsService productsServices, IIngredientsService ingredientsServices, ICloudinaryService cloudinaryServices)
 {
     this.productsServices    = productsServices;
     this.ingredientsServices = ingredientsServices;
     this.cloudinaryServices  = cloudinaryServices;
 }
Ejemplo n.º 10
0
 public StadiumsController(IStadiumsService stadiumsService, ICloudinaryService cloudinaryService, IMapper mapper)
 {
     this.stadiumsService   = stadiumsService;
     this.cloudinaryService = cloudinaryService;
     this.mapper            = mapper;
 }
Ejemplo n.º 11
0
 public ProductsController(IMapper mapper, IProductRepository productRepository, ICloudinaryService cloudinaryService, IFileManager fileManager)
 {
     _fileManager       = fileManager;
     _mapper            = mapper;
     _cloudinaryService = cloudinaryService;
     _productRepository = productRepository;
 }
 public CitiesController(ICityRepository cityRepository, ICloudinaryService cloudinaryService, IFileManager fileManager)
 {
     _cityRepository    = cityRepository;
     _cloudinaryService = cloudinaryService;
     _fileManager       = fileManager;
 }
Ejemplo n.º 13
0
 public MaterialService(NeoSchoolDbContext db, IHttpContextAccessor httpContextAccessor, ICloudinaryService cloudinaryService, IDisciplineService disciplineService)
 {
     this.db = db;
     this.httpContextAccessor = httpContextAccessor;
     this.cloudinaryService   = cloudinaryService;
     this.disciplineService   = disciplineService;
 }
Ejemplo n.º 14
0
 public PhotosController(IDatingRepository repository, IMapper mapper, ICloudinaryService cloudinaryService)
 {
     _repository        = repository;
     _mapper            = mapper;
     _cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 15
0
 //for tests
 public UserController(ICreativeService CreativeService, IUserService UserService, ICloudinaryService CloudinaryService)
 {
     this.CreativeService   = CreativeService;
     this.UserService       = UserService;
     this.CloudinaryService = CloudinaryService;
 }
Ejemplo n.º 16
0
 public ProductService(IDeletableEntityRepository <Product> productRepository, ICloudinaryService cloudinaryService)
 {
     this.productRepository = productRepository;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 17
0
 public ToolsController(ICloudinaryService cloudinaryService)
 {
     this.cloudinaryService = cloudinaryService;
 }
 public CloudinaryController(ICloudinaryService cloudinaryService, IMapper mapper)
     : base(mapper)
 {
     this.cloudinaryService = cloudinaryService;
 }
 public ArticlesService(IDeletableEntityRepository <Article> articlesRepository, ICloudinaryService cloudinaryService)
 {
     this.articlesRepository = articlesRepository;
     this.cloudinaryService  = cloudinaryService;
 }
Ejemplo n.º 20
0
 public CoctailRepository(CoctailContext context, IMapper mapper, ICloudinaryService cloudinary)
 {
     _context    = context;
     _mapper     = mapper;
     _cloudinary = cloudinary;
 }
Ejemplo n.º 21
0
 public PublicacionController(IAuthService auth, IPlanService PlanServ, IInmuebleTipoService InmTipServ, ICiudadService CiudServ, ICloudinaryService Cloudinary, IInmuebleService inmServ, IImageService ImagenServ, IPublicacionService publicServ, IValidacionInmueble valInm)
 {
     this.auth       = auth;
     this.PlanServ   = PlanServ;
     this.InmTipServ = InmTipServ;
     this.CiudServ   = CiudServ;
     this.Cloudinary = Cloudinary;
     this.inmServ    = inmServ;
     this.ImagenServ = ImagenServ;
     this.publicServ = publicServ;
     this.valInm     = valInm;
 }
Ejemplo n.º 22
0
 public UserService(IDeletableEntityRepository <ApplicationUser> userRepository, ICloudinaryService cloudinaryService)
 {
     this.userRepository    = userRepository;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 23
0
 public OrdersController(IOrdersService ordersService, ICustomersService customersService, IGarageService garageService, IItemsService itemsService, IOrderItemsService orderItemsService, ICloudinaryService cloudinaryService)
 {
     this.ordersService     = ordersService;
     this.customersService  = customersService;
     this.garageService     = garageService;
     this.itemsService      = itemsService;
     this.orderItemsService = orderItemsService;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 24
0
 public NewsService(IDeletableEntityRepository <News> newsRepository, IDeletableEntityRepository <ApplicationUser> usersRepository, ICommentsService commentsService, ICloudinaryService cloudinary)
 {
     this.Cloudinary      = cloudinary;
     this.NewsRepository  = newsRepository;
     this.UsersRepository = usersRepository;
     this.CommentsService = commentsService;
 }
Ejemplo n.º 25
0
 public ProductController(IProductService productService, ICloudinaryService cloudinaryService)
 {
     this.productService    = productService;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 26
0
 public ArticlesController(IArticlesService articlesService, ICloudinaryService cloudinaryService)
 {
     this.articlesService   = articlesService;
     this.cloudinaryService = cloudinaryService;
 }
 public FactsController(IFactsService factsService, ICloudinaryService cloudinaryService)
 {
     this.factsService      = factsService;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 28
0
 public ImageUploadHandler(IUnitOfWorkFactory unitOfWorkFactory, ICloudinaryService cloudinary)
 {
     _cloudinary = cloudinary;
     _unitOfWork = unitOfWorkFactory.Create();
 }
 public StudentsService(KidsManagementDbContext db, ICloudinaryService cloudinaryService)
 {
     this.db = db;
     this.cloudinaryService = cloudinaryService;
 }
Ejemplo n.º 30
0
 public VehicleController(IVehicleService vehicleService, ICloudinaryService cloudinaryService)
 {
     _vehicleService    = vehicleService;
     _cloudinaryService = cloudinaryService;
 }