public void Simple_Status_Race()
        {
            IElectionRepository electionRepository = Substitute.For <IElectionRepository>();
            var f        = new Fixture();
            var election = f.Create <Election>();
            var race     = Create(election.GetMasterDataRef());

            electionRepository.GetById(Arg.Any <Guid>()).Returns(election);
            var raceRepository = new RaceRepository(ContextConnection(), electionRepository);

            raceRepository.Save(race);
            raceRepository.SetInactive(race);
            var inactive = raceRepository.GetById(race.Id);

            Assert.That(inactive.Status == EntityStatus.Inactive);

            raceRepository.SetActive(race);
            var active = raceRepository.GetById(race.Id);

            Assert.That(active.Status == EntityStatus.Active);

            raceRepository.SetAsDeleted(race);
            var deleted = raceRepository.GetById(race.Id);

            Assert.That(deleted.Status == EntityStatus.Deleted);
        }
Exemple #2
0
 public PoliticPartiesController(IPoliticPartyService politicPartyService, IElectionRepository electionRepository,
                                 IHostingEnvironment hostingEnvironment, IElectionService electionService)
 {
     this._politicPartyService = politicPartyService;
     this._electionRepository  = electionRepository;
     this._hostingEnvironment  = hostingEnvironment;
     this._electionService     = electionService;
 }
 public CountingServices(IElectionRepository electionServices,
                         IVoteRepository voteRepository,
                         IPartyServices partyServices)
 {
     _electionServices = electionServices;
     _voteRepository   = voteRepository;
     _partyServices    = partyServices;
 }
 public ElectionController(IConfiguration config, IElectionRepository electionRepository,
                           ICategoryRepository categoryRepository, ITicketRepository ticketRepository,
                           IBallotRepository ballotRepository) : base(config)
 {
     this.electionRepository = electionRepository;
     this.categoryRepository = categoryRepository;
     this.ticketRepository   = ticketRepository;
     this.ballotRepository   = ballotRepository;
 }
Exemple #5
0
 public ElectionService(IElectionRepository electionRepository, IElectionCandidateRepository electionCandidateRepository,
                        IElectionCitizenRepository electionCitizenRepository, IElectionPoliticPartyRepository electionPoliticPartyRepository,
                        IElectionPositionRepository electionPositionRepository, IResultRepository resultRepository)
 {
     _electionRepository             = electionRepository;
     _electionCandidateRepository    = electionCandidateRepository;
     _electionCitizenRepository      = electionCitizenRepository;
     _electionPoliticPartyRepository = electionPoliticPartyRepository;
     _electionPositionRepository     = electionPositionRepository;
     _resultRepository = resultRepository;
 }
Exemple #6
0
 public ElectionPresentation(
     ICandidateRepository candidatesRepository,
     IElectionRepository electionRepository,
     IBallotRepository ballotRepository,
     IUserService userService,
     IMapper mapper)
 {
     _candidateRepository = candidatesRepository;
     _electionRepository  = electionRepository;
     _ballotRepository    = ballotRepository;
     _userService         = userService;
     _mapper = mapper;
 }
        public void SimpeHydrate_Race()
        {
            IElectionRepository electionRepository = Substitute.For <IElectionRepository>();
            var f        = new Fixture();
            var election = f.Create <Election>();
            var race     = Create(election.GetMasterDataRef());

            electionRepository.GetById(Arg.Any <Guid>()).Returns(election);
            var raceRepository = new RaceRepository(ContextConnection(), electionRepository);
            var id             = raceRepository.Save(race);

            Assert.IsNotNull(id);
            Assert.AreEqual(id, race.Id);
        }
 public HomeController(
     IWebHostEnvironment hostEnvironment,
     IArticleRepository articleRepository,
     IElectionRepository electionRepository,
     IAuthorsRepository authorsRepository,
     IPicturesRepository picturesRepository,
     IOptions <AWSS3Settings> aws3Settings)
 {
     webHostEnvironment  = hostEnvironment;
     _articleRepository  = articleRepository;
     _electionRepository = electionRepository;
     _authorsRepository  = authorsRepository;
     _picturesRepository = picturesRepository;
     _awsS3Settings      = aws3Settings;
 }
        public void SimpeDeHydrateAll_Race()
        {
            IElectionRepository electionRepository = Substitute.For <IElectionRepository>();
            var f        = new Fixture();
            var election = f.Create <Election>();
            var race     = Create(election.GetMasterDataRef());

            electionRepository.GetById(Arg.Any <Guid>()).Returns(election);
            var raceRepository = new RaceRepository(ContextConnection(), electionRepository);

            raceRepository.Save(race);
            var owner = raceRepository.GetAll();

            Assert.That(owner.Any());
        }
Exemple #10
0
 public ElectionController(IElectionRepository repository, IUnitOfWork unitOfWork, IMapper mapper)
 {
     _mapper     = mapper;
     _unitOfWork = unitOfWork;
     _repository = repository;
 }
Exemple #11
0
 public RaceRepository(ContextConnection contextConnection, IElectionRepository electionRepository)
     : base(contextConnection)
 {
     _electionRepository = electionRepository;
 }
Exemple #12
0
 public FPTPVotingCalculator(IElectionRepository repository) : base()
 {
     _repository = repository;
 }
 public ElectionServices(IElectionRepository electionRepository)
 {
     _electionRepository = electionRepository;
 }
 public ElectionService()
 {
     _electionRepository = new ElectionRepository();
 }
Exemple #15
0
 public ElectionService(IElectionRepository electionRepository, ICandidateRepository candidateRepository)
 {
     _electionRepository  = electionRepository;
     _candidateRepository = candidateRepository;
 }
 public ElectionService()
 {
     _electionRepository = RepositoryFactory.Get <IElectionRepository>();
 }
 public PositionController(IElectionRepository repository)
 {
     _repository = repository;
 }