public VotingFinisher(IVotingCandidateRepository votingCandidateRepository, ISongRepository songRepository, ICurrentSongService currentSongService, IVotingCandidateService votingCandidateService, ILogger logger)
 {
     _votingCandidateRepository = votingCandidateRepository;
     _songRepository            = songRepository;
     _currentSongService        = currentSongService;
     _votingCandidateService    = votingCandidateService;
     _logger = logger;
 }
 public VotingController(IVotingCandidateRepository votingCandidateRepository, IUnitOfWork unitOfWork, IPrimitiveUserIdentificationService primitiveUserIdentificationService, IVoteService voteService, IMessageQueueService messageQueueService, IMapper mapper)
 {
     _votingCandidateRepository = votingCandidateRepository;
     _unitOfWork = unitOfWork;
     _primitiveUserIdentificationService = primitiveUserIdentificationService;
     _voteService         = voteService;
     _messageQueueService = messageQueueService;
     _mapper = mapper;
 }
示例#3
0
        public void Setup()
        {
            _votingCandidateRepository = Substitute.For <IVotingCandidateRepository>();
            _songRepository            = Substitute.For <ISongRepository>();
            _currentSongService        = Substitute.For <ICurrentSongService>();
            _votingCandidateService    = Substitute.For <IVotingCandidateService>();
            _logger = Substitute.For <ILogger>();

            _votingFinisher = new VotingFinisher(_votingCandidateRepository, _songRepository, _currentSongService, _votingCandidateService, _logger);
        }
        private static void CreateAndAddVotingCandidate(int number, int numberOfVotes, IVotingCandidateRepository votingCandidateRepository, IVoteRepository voteRepository, ISongRepository songRepository)
        {
            var song = songRepository.Create();

            song.Title             = "SongRepositoryTests" + number;
            song.DurationInSeconds = 120;
            song.FileName          = "SongRepositoryTests.mp3";

            songRepository.Add(song);

            var votingCandidate = votingCandidateRepository.Create();

            votingCandidate.SongId       = song.Id;
            votingCandidate.Song         = song;
            votingCandidate.DisplayOrder = number;

            votingCandidateRepository.Add(votingCandidate);

            foreach (var index in Enumerable.Range(0, numberOfVotes))
            {
                var vote = voteRepository.Create();
                vote.VotingCandidateId = votingCandidate.Id;
                vote.VotingCandidate   = votingCandidate;
                vote.UserIdentifier    = Guid.NewGuid();

                voteRepository.Add(vote);
            }
        }
示例#5
0
        public void Setup()
        {
            _votingCandidateRepository = Substitute.For <IVotingCandidateRepository>();

            _votingCandidateService = new VotingCandidateService(_votingCandidateRepository);
        }
示例#6
0
 public VotingCandidateService(IVotingCandidateRepository votingCandidateRepository)
 {
     _votingCandidateRepository = votingCandidateRepository;
 }