Example #1
0
 public MatchService(IMatchRepository matchRepository, IUserRepository userRepository, ISummaryRepository summaryRepository, IVacancyRepository vacancyRepository)
 {
     _matchRepository   = matchRepository ?? throw new ArgumentException(nameof(matchRepository));
     _userRepository    = userRepository ?? throw new ArgumentException(nameof(userRepository));
     _summaryRepository = summaryRepository ?? throw new ArgumentException(nameof(summaryRepository));
     _vacancyRepository = vacancyRepository ?? throw new ArgumentException(nameof(vacancyRepository));
 }
        public void SummarySuggestionServiceSetUp()
        {
            var recruiter       = new User("", "", UserType.Recruiter);
            var specializations = new List <Specialization>()
            {
                new Specialization("Spec1"), new Specialization("Spec2")
            };
            var vacancy   = new Vacancy(recruiter, specializations[0], new List <Skill>(), "");
            var summaries = new List <Summary>();

            for (int i = 0; i < 10; i++)
            {
                summaries.Add(new Summary(new User("", "", UserType.Candidate), specializations[i % 2],
                                          new List <Skill>(), ""));
            }

            _userRepository = Mock.Of <IUserRepository>(
                x => x.Get(0) == recruiter);
            _vacancyRepository = Mock.Of <IVacancyRepository>(
                x => x.GetForUser(0) == vacancy && x.Get(0) == vacancy);
            _summaryRepository = Mock.Of <ISummaryRepository>(
                x => x.Get() == summaries);
            _summarySuggestionRepository = new SummarySuggestionRepositoryMock(new List <SummarySuggestion>());

            _summarySuggestionService = new SummarySuggestionService(_summarySuggestionRepository, _vacancyRepository, _userRepository, _summaryRepository, Mock.Of <IMatchService>());

            _rule = new SimpleSummaryRule(specializations[0], new List <Skill>());
        }
Example #3
0
 public ServiceWorker(DataContext context)
 {
     if (context == null)
     {
         throw new ArgumentNullException();
     }
     _dataRepo    = new DataRepository(context);
     _analyseRepo = new AnalyseRepository(context);
     _monitorRepo = new MonitorRepository(context);
     _summaryRepo = new SummaryRepository(context);
     _tasks       = new List <ITask> {
         new UpdateCompanyTask(_dataRepo),
         new UpdateEodTask(_dataRepo),
         new AnalyzeProfitTask(_analyseRepo),
         new AnalyzeRSITask(_analyseRepo),
         new AnalyzeSMATask(_analyseRepo),
         new AnalyzeRSIPredictTask(_analyseRepo),
         new AnalyzeRSIRangeTask(_analyseRepo),
         new AnalyzeGainLossTask(_analyseRepo),
         new AnalyzeADXTask(_analyseRepo),
         new AnalyzeMACDTask(_analyseRepo),
         new AnalyzeBollingerBandsTask(_analyseRepo),
         new MonitorRSITask(_monitorRepo),
         new DailySummaryTask(_summaryRepo),
     };
 }
Example #4
0
 public ParkingController(ICarsParkingRepository repo, ISummaryRepository repoSum)
 {
     _repository            = repo;
     _repositorySum         = repoSum;
     ParkingLot.CarsParking = _repository.Cars.Count();
     ParkingLot.Sum         = (double)(from database in _repositorySum.CurrentProfits orderby database.ID descending select database.CurrentSum).FirstOrDefault();
     ParkingLot.TotalCars   = (from database in _repositorySum.CurrentProfits orderby database.ID descending select database.TotalCars).FirstOrDefault();
 }
 public ParkingController(ICarsParkingRepository repo, ISummaryRepository repoSum)
 {
     _repository = repo;
     _repositorySum = repoSum;
     ParkingLot.CarsParking = _repository.Cars.Count();
     ParkingLot.Sum = (double)(from database in _repositorySum.CurrentProfits orderby database.ID descending select database.CurrentSum).FirstOrDefault();
     ParkingLot.TotalCars = (from database in _repositorySum.CurrentProfits orderby database.ID descending select database.TotalCars).FirstOrDefault();
 }
Example #6
0
 public SumaryController(
     IMapper mapper,
     ISummaryRepository summaryRepository,
     ILogger <SumaryController> logger)
 {
     _mapper            = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _summaryRepository = summaryRepository ?? throw new ArgumentNullException(nameof(summaryRepository));
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 public VacancySuggestionService(IVacancySuggestionRepository vacancySuggestionRepository,
                                 ISummaryRepository summaryRepository, IUserRepository userRepository, IVacancyRepository vacancyRepository, IMatchService matchService)
 {
     _vacancySuggestionRepository = vacancySuggestionRepository ?? throw new ArgumentException(nameof(vacancySuggestionRepository));
     _summaryRepository           = summaryRepository ?? throw new ArgumentException(nameof(summaryRepository));
     _userRepository    = userRepository ?? throw new ArgumentException(nameof(userRepository));;
     _vacancyRepository = vacancyRepository ?? throw new ArgumentException(nameof(vacancyRepository));
     _matchService      = matchService ?? throw new ArgumentException(nameof(matchService));
 }
Example #8
0
 public SummaryService(ISummaryRepository summaryRepository,
                       IUserRepository userRepository,
                       ISkillRepository skillRepository,
                       ISpecializationRepository specializationRepository)
 {
     _summaryRepository        = summaryRepository ?? throw new ArgumentException(nameof(summaryRepository));
     _userRepository           = userRepository ?? throw new ArgumentException(nameof(userRepository));
     _skillRepository          = skillRepository ?? throw new ArgumentException(nameof(skillRepository));
     _specializationRepository =
         specializationRepository ?? throw new ArgumentException(nameof(skillRepository));
 }
Example #9
0
 public PersistToRepositoryFunctions(
     IDocumentReadRepository <TReadModel> documentReadRepository,
     ISummaryRepository <TPersistedType> documentWriteRepository,
     IApplicationVersion versionConfig,
     ILogger logger,
     IRepoConfig repoConfig,
     IAppCache cache,
     string cacheCollectionKey,
     IMediator mediator,
     Func <TPersistedType, string> getKey,
     Func <TPersistedType, string> getKey2)
 {
     _documentReadRepository  = documentReadRepository;
     _documentWriteRepository = documentWriteRepository;
     _getKey             = getKey;
     _getKey2            = getKey2;
     _versionConfig      = versionConfig;
     _logger             = logger;
     _repoConfig         = repoConfig;
     _cache              = cache;
     _cacheCollectionKey = cacheCollectionKey;
     _mediator           = mediator;
 }
Example #10
0
        public void Setup()
        {
            accessToken  = "access_token";
            stravaId     = 123;
            stravaClient = Substitute.For <IStravaClient>();;
            context      = Substitute.For <ISummaryRepository>();

            //Mock stravaClient
            IEnumerable <VisualActivity> activities        = TestData.VisualActivitiesList();
            IEnumerable <VisualActivity> newUserActivities = TestData.NewVisualActivitiesList();

            stravaClient.getAllUserActivities(accessToken, 123).Returns(activities);
            stravaClient.getAllUserActivities(accessToken, 2222).Returns(newUserActivities);
            stravaClient.getUserActivitiesByIdAfter(accessToken, Arg.Any <User>(), Arg.Any <DateTime>()).Returns(newUserActivities);

            //Mock repository
            var stravaUser = new User {
                UserId = 123, MonthSummaries = TestData.MonthSummaryActivityList()
            };

            context = Substitute.For <ISummaryRepository>();
            context.GetUserById(123).Returns(stravaUser);
            context.GetUserById(2222).Returns(new User());
        }
 public SummaryController(ISummaryRepository summaryRepository)
 {
     this.summaryRepository = summaryRepository;
 }
Example #12
0
 public DailySummaryTask(ISummaryRepository summaryRepository)
 {
     _summaryRepository = summaryRepository;
 }
Example #13
0
 public SummaryService(ISummaryRepository summaryRepository, IGameRepository gameRepository, IPlayerProfileRepository playerProfileRepository)
 {
     _playerProfileRepository = playerProfileRepository;
     _summaryRepository       = summaryRepository;
     _gameRepository          = gameRepository;
 }
Example #14
0
 public SummaryController(ISummaryRepository context, IStravaClient stravaClient)
 {
     this.context      = context;
     this.stravaClient = stravaClient;
 }
Example #15
0
 public SkillsRepository(ISummaryRepository summaryRepository)
 {
     _summaryRepository = summaryRepository;
 }
 public SessionController(ISessionRepository sessionRepo, IMemoryCache cache, ISummaryRepository summaryRepo)
 {
     this.sessionRepository = sessionRepo;
     this.summaryRepository = summaryRepo;
     this.userStateManager  = new UserStateManager(cache);
 }
Example #17
0
 public SummaryController(ISummaryRepository repo)
 {
     this.repository = repo;
 }
 public ReportController(ISummaryRepository repo, IPercentageCalculator calc, ICohortTotalsRepository CohortTotals)
 {
     this.db = repo;
     this.Calculator = calc;
     this.CohortTotals = CohortTotals;
 }
Example #19
0
 public AccountsRepository(ISummaryRepository summaryRepository)
 {
     _summaryRepository = summaryRepository;
 }
 public SummaryRequestHandler(ISummaryRepository summaryRepository, IMapper mapper)
 {
     fSummaryRepository = summaryRepository;
     fMapper            = mapper;
 }
Example #21
0
 public OpportunitiesRepository(ISummaryRepository summaryRepository, IAccountsRepository accountsRepository)
 {
     _summaryRepository  = summaryRepository;
     _accountsRepository = accountsRepository;
 }
Example #22
0
 public SummaryService(ISummaryRepository summaryRepository, ILog log)
 {
     _summaryRepository = summaryRepository;
     Log = log;
 }
Example #23
0
 public LimitTests()
 {
     Repository = new EfCurrentProfitRepository();
 }
Example #24
0
 public SummaryService(ISummaryRepository repository, IMapper mapper)
 {
     _repository = repository ?? throw new ArgumentNullException(nameof(repository));
     _mapper     = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }