public void Index_Update_Name()
        {
            //Arrange
            IClubRepository sut  = GetInMemoryClubRepository();
            Club            club = new Club()
            {
                ClubID = 1,
                Name   = "Rathfarnham Mock",
                Number = "123 4567899",
                Email  = "*****@*****.**"
            };
            Club newClub = new Club()
            {
                ClubID = 1,
                Name   = "Updated Club",
            };

            //Act
            sut.CreateClub(club);
            Club updatedClub = sut.UpdateClub(newClub);

            //Assert
            Assert.Single(sut.GetClubs());
            Assert.Equal("Updated Club", updatedClub.Name);
        }
        public void Missing_Four_Required_Properties()
        {
            //Arrange
            IClubRepository         sut = GetInMemoryClubRepository();
            CheckPropertyValidation cpv = new CheckPropertyValidation();

            Club club = new Club()
            {
                ClubID = 1,
                //Name = "Rathfarnham Mock",
                //Number = "123 4567899",
                //Email = "*****@*****.**",
                //Address = "1 Main Street",
                ClubImage1 = "image1.png",
                ClubImage2 = "image2.png",
                ClubImage3 = "image3.png",
            };

            //Act
            sut.CreateClub(club);

            //Assert
            var errorcount = cpv.myValidation(club).Count();

            Assert.Equal(4, errorcount);
        }
        public void Index_AllItems()
        {
            //Arrange
            IClubRepository sut  = GetInMemoryClubRepository();
            Club            club = new Club()
            {
                ClubID     = 1,
                Name       = "Rathfarnham Mock",
                Number     = "123 4567899",
                Email      = "*****@*****.**",
                Address    = "1 Main Street",
                ClubImage1 = "image1.png",
                ClubImage2 = "image2.png",
                ClubImage3 = "image3.png",
            };

            //Act
            Club savedClub = sut.CreateClub(club);

            //Assert
            Assert.Single(sut.GetClubs());
            Assert.Equal("Rathfarnham Mock", savedClub.Name);
            Assert.Equal("123 4567899", savedClub.Number);
            Assert.Equal("*****@*****.**", savedClub.Email);
            Assert.Equal("1 Main Street", savedClub.Address);
            Assert.Equal("image1.png", savedClub.ClubImage1);
            Assert.Equal("image2.png", savedClub.ClubImage2);
            Assert.Equal("image3.png", savedClub.ClubImage3);
        }
        public void Multiple_Clubs()
        {
            //Arrange
            IClubRepository sut  = GetInMemoryClubRepository();
            Club            club = new Club()
            {
                ClubID = 1,
                Name   = "Rathfarnham Mock",
                Number = "123 4567899",
                Email  = "*****@*****.**"
            };
            Club club2 = new Club()
            {
                ClubID = 2,
                Name   = "Mock",
                Number = "1234567899",
                Email  = "*****@*****.**"
            };

            //Act
            sut.CreateClub(club);
            sut.CreateClub(club2);

            //Assert
            Assert.Equal(2, sut.GetClubs().Count);
        }
Example #5
0
        public SampleModule(IClubRepository clubRepository)
        {
            _clubRepository = clubRepository;

            var clubs = _clubRepository.GetClubs().ToList();
            Get["/"] = _ => View["index", clubs];
        }
 // Pattern d'Injection de Dépendance
 // aka IoC : Inversion of Control
 // aka DI : Dependency Injection
 public InMemoryContractRepository(
     IPlayerRepository playerRepository,
     IClubRepository clubRepository)
 {
     _clubRepository   = clubRepository;
     _playerRepository = playerRepository;
 }
Example #7
0
 /// <summary>
 ///  Initializes a new istance of the <see cref="ClubsController"/> class.
 /// </summary>
 /// <param name="_context">Context instance</param>
 /// <param name="_logger">Logger instance</param>
 /// <param name="_mapper">Mapper instance</param>
 public ClubsController(FootballManagerContext context, IClubRepository repository, ILogger <ClubsController> logger, IMapper mapper)
 {
     _context    = context;
     _repository = repository;
     _logger     = logger;
     _mapper     = mapper;
 }
        public Seed(UserManager <User> userManager,
                    RoleManager <Role> roleManager,
                    IUnitOfWork unitOfWork,
                    ISeasonRepository seasonRepository,
                    IStadiumRepository stadiumRepository,
                    IClubRepository clubRepository,
                    ISquadRepository squadRepository,
                    IKitRepository kitRepository,
                    IManagerRepository managerRepository,
                    IPlayerRepository playerRepository)
        {
            _userManager       = userManager;
            _roleManager       = roleManager;
            _unitOfWork        = unitOfWork;
            _seasonRepository  = seasonRepository;
            _stadiumRepository = stadiumRepository;
            _clubRepository    = clubRepository;
            _squadRepository   = squadRepository;
            _kitRepository     = kitRepository;
            _managerRepository = managerRepository;
            _playerRepository  = playerRepository;

            _jsonSerializerSettings = new JsonSerializerSettings
            {
                NullValueHandling     = NullValueHandling.Ignore,
                MissingMemberHandling = MissingMemberHandling.Ignore
            };
        }
Example #9
0
 public PersonService(
     IClubRepository clubRepository,
     IPersonRepository personRepository)
 {
     _clubRepository   = clubRepository;
     _personRepository = personRepository;
 }
 // Pattern d'Injection de Dépendance
 // aka IoC : Inversion of Control
 // aka DI : Dependency Injection
 public InMemoryHistoricRepository(
     IClubRepository clubRepository,
     IPlayerRepository playerRepository)
 {
     _clubRepository   = clubRepository;
     _playerRepository = playerRepository;
 }
Example #11
0
 public Service(StatefulServiceContext context,
                ICupRepository cupRepository, IClubRepository clubRepository)
     : base(context)
 {
     _cupRepository  = cupRepository;
     _clubRepository = clubRepository;
 }
Example #12
0
 public Authentication(IPlayerRepository <Player> playerRepos, IClubRepository <Club> clubRepos,
                       IOptions <AppSettings> appSettings)
 {
     this.playerRepos = playerRepos;
     this.clubRepos   = clubRepos;
     this.appSettings = appSettings.Value;
 }
 public MyAccountController(IRestaurantRepository repo, IClubRepository club, IWebHostEnvironment env, UserManager <ApplicationUser> userManager)
 {
     _RepositoryClub = club;
     _Repository     = repo;
     _env            = env;
     _userManager    = userManager;
 }
Example #14
0
 public ClubController(
     ILogger <ClubController> logger,
     IClubRepository clubRepository)
 {
     _logger         = logger;
     _clubRepository = clubRepository;
 }
Example #15
0
 public AuthenticateController(Authentication authentication, IPlayerRepository <Player> playerRepos,
                               IClubRepository <Club> clubRepos, UserManager <User> userManager)
 {
     this.authentication = authentication;
     this.playerRepos    = playerRepos;
     this.clubRepos      = clubRepos;
     this.userManager    = userManager;
 }
Example #16
0
 public ClubController(
     IClubRepository subNineRepository,
     IMapper mapper
     )
 {
     this.subNineRepository = subNineRepository;
     this.mapper            = mapper;
 }
Example #17
0
 public EmailController(IConfiguration iConfig, IClubRepository <Club> clubRepos,
                        Authentication authentication, IPlayerRepository <Player> playerRepos, UserManager <User> userManager)
 {
     confirguration      = iConfig;
     _clubRepos          = clubRepos;
     _playerRepos        = playerRepos;
     this.authentication = authentication;
     this.userManager    = userManager;
 }
Example #18
0
 public SeedData(
     ApplicationDbContext dbContext,
     IClubRepository clubRepository,
     IJoueurRepository joueurRepository)
 {
     _dbContext        = dbContext;
     _clubRepository   = clubRepository;
     _joueurRepository = joueurRepository;
 }
Example #19
0
 public TeamServices(ITeamRepository teamRepository, IPlayerRepository playerRepository, ICoachRepository coachRepository, ICurriculumRepository curriculumRepository, ITeamCurriculumRepository teamCurriculumRepository, IClubRepository clubRepository)
 {
     _teamRepository = teamRepository;
     _playerRepository = playerRepository;
     _coachRepository = coachRepository;
     _curriculumRepository = curriculumRepository;
     _teamCurriculumRepository = teamCurriculumRepository;
     _clubRepository = clubRepository;
 }
Example #20
0
 public ClubService(IClubRepository clubRepository, IMapper mapper, IRateRepository rateRepository,
                    IFavouriteRepository favouriteRepository, ITrainingRepository trainingRepository)
 {
     _clubRepository      = clubRepository;
     _rateRepository      = rateRepository;
     _favouriteRepository = favouriteRepository;
     _trainingRepository  = trainingRepository;
     _mapper = mapper;
 }
Example #21
0
 public CurriculumServices(ICurriculumRepository curriculumRepository, ISessionRepository curriculumSessionRepository, IClubRepository clubRepository, ICurriculumStatementRepository curriculumStatementRepository, IStatementRolesRepository statementRolesRepository, IScenarioRepository scenarioRepository)
 {
     _curriculumRepository = curriculumRepository;
     _sessionRepository = curriculumSessionRepository;
     _clubRepository = clubRepository;
     _curriculumStatementRepository = curriculumStatementRepository;
     _statementRolesRepository = statementRolesRepository;
     _scenarioRepository = scenarioRepository;
 }
 public ClubService(IClubRepository clubRepository, IMemberRepository clubMemberRepository, IFlightRepository flightRpository, IAsyncRepository <Aircraft> asyncRepositoryAircraft, IAircraftLogBookRepository aircraftLogbookRepository = null, IAppLogger <ClubService> logger = null)
 {
     _clubRepository            = clubRepository;
     _clubMemberRepository      = clubMemberRepository;
     _aircraftLogbookRepository = aircraftLogbookRepository;
     _logger                  = logger;
     _flightRepository        = flightRpository;
     _asyncRepositoryAircraft = asyncRepositoryAircraft;
 }
 public ClubService(
     IClubRepository clubRepository,
     IPersonRepository personRepository,
     IDogRepository dogRepository
     )
 {
     _clubRepository   = clubRepository;
     _personRepository = personRepository;
     _dogRepository    = dogRepository;
 }
Example #24
0
 public PlayerServices(IPlayerRepository playerRepository, IActivityStatusChangeRepository activityStatusChangeRepository, ITeamRepository teamRepository, IUserRepository userRepository, IClubRepository clubRepository, IAddressRepository addressRepository, IUserDetailRepository userDetailRepository)
 {
     _playerRepository = playerRepository;
     _activityStatusChangeRepository = activityStatusChangeRepository;
     _teamRepository = teamRepository;
     _userRepository = userRepository;
     _clubRepository = clubRepository;
     _addressRepository = addressRepository;
     _userDetailRepository = userDetailRepository;
 }
Example #25
0
 public CreateContactCommandHandler(ILoggerFactory loggerFactory, IUnitOfWork unitOfWork, CreateContactCommandValidator validator, IContactRepository contactRepository, IClubRepository clubRepository, ITeamRepository teamRepository, IAssociationRepository associationRepository)
 {
     this._logger                = loggerFactory.CreateLogger <CreateContactCommandHandler>();
     this._unitOfWork            = unitOfWork;
     this._validator             = validator;
     this._contactRepository     = contactRepository;
     this._clubRepository        = clubRepository;
     this._teamRepository        = teamRepository;
     this._associationRepository = associationRepository;
 }
 public CreateClubSurfaceController(IUmbracoContextAccessor umbracoContextAccessor, IUmbracoDatabaseFactory umbracoDatabaseFactory, ServiceContext serviceContext,
                                    AppCaches appCaches, ILogger logger, IProfilingLogger profilingLogger, UmbracoHelper umbracoHelper, IClubRepository clubRepository, IRouteGenerator routeGenerator,
                                    IAuthorizationPolicy <Club> authorizationPolicy, ICacheOverride cacheOverride)
     : base(umbracoContextAccessor, umbracoDatabaseFactory, serviceContext, appCaches, logger, profilingLogger, umbracoHelper)
 {
     _clubRepository      = clubRepository ?? throw new System.ArgumentNullException(nameof(clubRepository));
     _routeGenerator      = routeGenerator ?? throw new System.ArgumentNullException(nameof(routeGenerator));
     _authorizationPolicy = authorizationPolicy ?? throw new System.ArgumentNullException(nameof(authorizationPolicy));
     _cacheOverride       = cacheOverride ?? throw new ArgumentNullException(nameof(cacheOverride));
 }
Example #27
0
 public SeedData(
     ApplicationDbContext dbContext,
     IClubRepository clubRepository,
     IPlayerRepository playerRepository,
     IHistoricRepository historicRepository)
 {
     _dbContext          = dbContext;
     _clubRepository     = clubRepository;
     _playerRepository   = playerRepository;
     _historicRepository = historicRepository;
 }
Example #28
0
 public SeedData(
     ApplicationDbContext dbContext,
     IClubRepository ClubRepository,
     IPlayerRepository PlayerRepository,
     IContractRepository ContractRepository)
 {
     _dbContext          = dbContext;
     _ClubRepository     = ClubRepository;
     _PlayerRepository   = PlayerRepository;
     _ContractRepository = ContractRepository;
 }
Example #29
0
 public ClubsAppService(
     ClubPlayerManager clubPlayerManager,
     IClubPlayerRepository clubPlayerRepository,
     IClubRepository clubRepository,
     IPlayerRepository playerRepository)
 {
     _clubPlayerManager    = clubPlayerManager;
     _clubPlayerRepository = clubPlayerRepository;
     _clubRepository       = clubRepository;
     _playerRepository     = playerRepository;
 }
 public ClubController(
     IClubRepository clubRepository,
     IEventRepository eventRepository,
     IMapper mapper,
     IUnitOfWork unitOfWork)
 {
     _clubRepository  = clubRepository;
     _eventRepository = eventRepository;
     _mapper          = mapper;
     _unitOfWork      = unitOfWork;
 }
Example #31
0
        public CupService(StatefulServiceContext context, ICupRepository cupRepository, IClubRepository clubRepository)
            : base(context)
        {
            //if (!StateManager.TryAddStateSerializer(new LeaderboardSerializer()))
            //{
            //    throw new InvalidOperationException("Failed to set Leaderboard custom serializer");
            //}

            _cupRepository  = cupRepository;
            _clubRepository = clubRepository;
        }
 public CreateCompetitionCommandHandler(IUnitOfWork unitOfWork, ISeasonRepository seasonRepository, ICompetitionHeaderRepository competitionHeaderRepository,
                                        ICompetitionRepository competitionRepository,
                                        IGameVariationRepository gameVariationRepository, CreateCompetitionCommandValidator validator, IClubRepository clubRepository)
 {
     this._unitOfWork = unitOfWork;
     this._competitionHeaderRepository = competitionHeaderRepository;
     this._competitionRepository       = competitionRepository;
     this._seasonRepository            = seasonRepository;
     this._gameVariationRepository     = gameVariationRepository;
     this._validator      = validator;
     this._clubRepository = clubRepository;
 }
Example #33
0
 public UpdateOnlineRegistrationConfigurationCommandHandler(ILoggerFactory loggerFactory, IUnitOfWork unitOfWork, ICompetitionRepository competitionRepository, ICompetitionRegistrationConfigurationRepository configurationRepository,
                                                            IContactRepository contactRepository, IAssociationRepository associationRepository, IClubRepository clubRepository)
 {
     this._logger                  = loggerFactory.CreateLogger <UpdateOnlineRegistrationConfigurationCommandHandler>();
     this._unitOfWork              = unitOfWork;
     this._competitionRepository   = competitionRepository;
     this._configurationRepository = configurationRepository;
     this._contactRepository       = contactRepository;
     this._associationRepository   = associationRepository;
     this._clubRepository          = clubRepository;
     this._validationResult        = new ValidationResult();
 }
 public AdminController(
         IPlayerRepository repoPlayers,
         IClubRepository repoClubs,
         IPositionRepository repoPositions,
         IStatRepository repoStats,
         IAppDataRepository repoAppData)
 {
     repositoryPlayers = repoPlayers;
     repositoryClubs = repoClubs;
     repositoryPositions = repoPositions;
     repositoryStats = repoStats;
     repositoryAppData = repoAppData;
 }
Example #35
0
 public SeedData(
     ApplicationDbContext dbContext,
     ICityRepository cityRepository,
     IPersonRepository personRepository,
     IPlayerRepository playerRepository,
     IClubRepository clubRepository,
     IContractRepository contractRepository)
 {
     _dbContext          = dbContext;
     _cityRepository     = cityRepository;
     _personRepository   = personRepository;
     _playerRepository   = playerRepository;
     _clubRepository     = clubRepository;
     _contractRepository = contractRepository;
 }
Example #36
0
 public ClubServices(IClubRepository clubRepository,
                         IWelfareOfficerRepository welfareOfficerRepository,
                         IChairmanRepository chairmanRepository,
                         IClubAdminRepository clubAdminRepository,
                         IUserDetailRepository userDetailRepository,
                         IUserRepository userRepository,
                         IAddressRepository addressRepository)
 {
     _clubRepository = clubRepository;
     _welfareOfficerRepository = welfareOfficerRepository;
     _chairmanRepository = chairmanRepository;
     _clubAdminRepository = clubAdminRepository;
     _userDetailRepository = userDetailRepository;
     _userRepository = userRepository;
     _addressRepository = addressRepository;
 }
Example #37
0
 public UserServices(IUserRepository userRepository, IClubAdminRepository clubAdminRepository,
     ICoachRepository coachRepository, IClubRepository clubRepository,
     IWelfareOfficerRepository welfareOfficerRepository, IScoutRepository scoutRepository,
     IPhysiotherapistRepository physiotherapistRepository, IHeadOfEducationRepository headOfEducationRepository,
     IHeadOfAcademyRepository headOfAcademyRepository, ISportScientistRepository sportScientistRepository,
     IAddressRepository addressRepository, IUserDetailRepository userDetailRepository, IPlayerRepository playerRepository)
 {
     _userRepository = userRepository;
     _clubAdminRepository = clubAdminRepository;
     _coachRepository = coachRepository;
     _clubRepository = clubRepository;
     _welfareOfficerRepository = welfareOfficerRepository;
     _scoutRepository = scoutRepository;
     _physiotherapistRepository = physiotherapistRepository;
     _headOfEducationRepository = headOfEducationRepository;
     _headOfAcademyRepository = headOfAcademyRepository;
     _sportScientistRepository = sportScientistRepository;
     _addressRepository = addressRepository;
     _userDetailRepository = userDetailRepository;
     _playerRepository = playerRepository;
 }
 //---------------------------------------------------------------------------------------------------
 static ClubRelationships()
 {
     s_event_repository = new EventRepository();
     s_club_repository = new ClubRepository();
     s_course_repository = new CourseRepository();
 }
 static ClubController()
 {
     s_repository = new ClubRepository();
     //DebugData data = new DebugData();
 }