示例#1
0
 public AdminController(IDashboardService dashboardService, ChallengeSetMapper challengeSetMapper, IResultsService resultsService, IAdminService adminService)
 {
     this.dashboardService   = dashboardService;
     this.challengeSetMapper = challengeSetMapper;
     this.resultsService     = resultsService;
     this.adminService       = adminService;
 }
示例#2
0
        public async Task GetPublishedProviderProfileForProviderIdAndSpecificationIdAndFundingStreamId_CallsCorrectly(
            string providerId,
            string specificationId,
            string fundingStreamId)
        {
            IResultsService       resultsService       = Substitute.For <IResultsService>();
            IResultsSearchService resultsSearchService = Substitute.For <IResultsSearchService>();
            ICalculationProviderResultsSearchService calculationProviderResultsSearchService = Substitute.For <ICalculationProviderResultsSearchService>();
            IPublishedResultsService publishedResultsService = Substitute.For <IPublishedResultsService>();
            IProviderCalculationResultsSearchService providerCalculationsResultsSearchService = Substitute.For <IProviderCalculationResultsSearchService>();
            IFeatureToggle featureToggle = Substitute.For <IFeatureToggle>();
            IProviderCalculationResultsReIndexerService providerCalculationResultsReIndexerService = Substitute.For <IProviderCalculationResultsReIndexerService>();

            ResultsController controller = new ResultsController(
                resultsService,
                resultsSearchService,
                calculationProviderResultsSearchService,
                publishedResultsService,
                providerCalculationsResultsSearchService,
                featureToggle,
                providerCalculationResultsReIndexerService);

            await controller.GetPublishedProviderProfileForProviderIdAndSpecificationIdAndFundingStreamId(providerId, specificationId, fundingStreamId);

            await publishedResultsService
            .Received(1)
            .GetPublishedProviderProfileForProviderIdAndSpecificationIdAndFundingStreamId(providerId, specificationId, fundingStreamId);

            //Moq has a .VerifyNoOtherCalls method which would be really useful here to confirm the others weren't called.
        }
 public ExamsController(IExamsService examsService, IResultsService resultsService, ICoursesService coursesService, UserManager <ApplicationUser> userManager)
 {
     this.examsService   = examsService;
     this.resultsService = resultsService;
     this.coursesService = coursesService;
     this.userManager    = userManager;
 }
 public ResultsController(
     IResultsService resultsService,
     UserManager <ApplicationUser> userManager)
 {
     this.resultsService = resultsService;
     this.userManager    = userManager;
 }
示例#5
0
        public ResultsController(
            IResultsService resultsService,
            IResultsSearchService resultsSearchService,
            ICalculationProviderResultsSearchService calculationProviderResultsSearchService,
            IPublishedResultsService publishedResultsService,
            IProviderCalculationResultsSearchService providerCalculationResultsSearchService,
            IFeatureToggle featureToggle,
            IProviderCalculationResultsReIndexerService providerCalculationResultsReIndexerService)
        {
            Guard.ArgumentNotNull(resultsSearchService, nameof(resultsSearchService));
            Guard.ArgumentNotNull(resultsService, nameof(resultsService));
            Guard.ArgumentNotNull(calculationProviderResultsSearchService, nameof(calculationProviderResultsSearchService));
            Guard.ArgumentNotNull(publishedResultsService, nameof(publishedResultsService));
            Guard.ArgumentNotNull(providerCalculationResultsSearchService, nameof(providerCalculationResultsSearchService));
            Guard.ArgumentNotNull(featureToggle, nameof(featureToggle));
            Guard.ArgumentNotNull(providerCalculationResultsReIndexerService, nameof(providerCalculationResultsReIndexerService));

            _resultsSearchService = resultsSearchService;
            _calculationProviderResultsSearchService = calculationProviderResultsSearchService;
            _publishedResultsService = publishedResultsService;
            _resultsService          = resultsService;
            _providerCalculationResultsSearchService = providerCalculationResultsSearchService;
            _featureToggle = featureToggle;
            _providerCalculationResultsReIndexerService = providerCalculationResultsReIndexerService;
        }
示例#6
0
 public OnProviderResultsSpecificationCleanup(
     ILogger logger,
     IResultsService resultsService,
     IMessengerService messengerService,
     IUserProfileProvider userProfileProvider, bool useAzureStorage = false)
     : base(logger, messengerService, FunctionName, $"{ServiceBusConstants.TopicNames.ProviderSourceDatasetCleanup}/{ServiceBusConstants.TopicSubscribers.CleanupCalculationResultsForSpecificationProviders}", useAzureStorage, userProfileProvider, resultsService)
 {
 }
示例#7
0
 public ResultsController(ILogService logService, IMapper mapper, ISessionService sessionService, IResultsService resultsService, IAssessmentService apiService)
     : base(sessionService)
 {
     this.logService     = logService;
     this.mapper         = mapper;
     this.resultsService = resultsService;
     this.apiService     = apiService;
 }
示例#8
0
        public StudentProfileViewModel(IAuthService authService, IAssignmentsService assignmentsService, IResultsService resultsService)
        {
            _authService        = authService;
            _assignmentsService = assignmentsService;
            _resultsService     = resultsService;

            selectedStudent    = _authService.authorisedUser;
            StudentAssignments = GetStudentAssignments();
        }
示例#9
0
        public LecturerStudentManagementViewModel(IAuthService authService, ILecturerService lecturerService, IUsersService usersService, IAssignmentsService assignmentsService, IResultsService resultsService)
        {
            _authService        = authService;
            _lecturerService    = lecturerService;
            _usersService       = usersService;
            _assignmentsService = assignmentsService;
            _resultsService     = resultsService;

            selectedLecturer = _authService.authorisedUser;
        }
示例#10
0
        public IndexTests()
        {
            mapper            = A.Fake <IMapper>();
            sessionService    = A.Fake <ISessionService>();
            assessmentService = A.Fake <IAssessmentService>();
            resultsService    = A.Fake <IResultsService>();
            logService        = A.Fake <ILogService>();

            controller = new ResultsController(logService, mapper, sessionService, resultsService, assessmentService);
        }
        public OnCalculationResultsCsvGeneration(
            ILogger logger,
            IResultsService resultsService)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(resultsService, nameof(resultsService));

            _logger         = logger;
            _resultsService = resultsService;
        }
示例#12
0
 public ResultsServiceShould()
 {
     this.attemptRepository = this.mockRepository.Create <IAttemptRepository>();
     this.userRepository    = this.mockRepository.Create <IUserRepository>();
     this.gameRepository    = new GameRepository();
     this.dashboardService  = new ResultsService(
         this.gameRepository,
         this.userRepository.Object,
         new BestAttemptsService(this.attemptRepository.Object));
 }
示例#13
0
        public SyncService(string databasePath, string mmeCode)
        {
            //_sqLiteDbService = new SQLiteDbService(new SQLiteConnection(databasePath));
            _mmeCode    = mmeCode;
            _connection = new SQLiteConnection(databasePath, false);
            _connection.Open();

            _saveProfileService = new SQLiteProfilesService(databasePath);
            _resultsService     = new SQLiteResultsServiceLocal(databasePath);
        }
        public static void SetupTests(TestContext tc)
        {
            SetupTests("results");

            _logger = CreateLogger();
            _providerResultsCsvGeneratorService = CreateProviderResultsCsvGeneratorService();
            _resultsService = CreateResultsService();
            _providerCalculationResultsReIndexerService = CreateProviderCalculationResultsReIndexerService();
            _userProfileProvider    = CreateUserProfileProvider();
            _providerResultsService = Substitute.For <ISpecificationsWithProviderResultsService>();
        }
示例#15
0
        public RolesTests()
        {
            mapper            = A.Fake <IMapper>();
            sessionService    = A.Fake <ISessionService>();
            assessmentService = A.Fake <IAssessmentService>();
            resultsService    = A.Fake <IResultsService>();
            testCategory      = "testCategory";
            logService        = A.Fake <ILogService>();

            controller = new ResultsController(logService, mapper, sessionService, resultsService, assessmentService);
        }
示例#16
0
        public SQLCentralDatabaseService(ApplicationSettingsBase Settings)
        {
            var connectionString = GetConnectionStringFromSettings(Settings);

            _connection = new SqlConnection(connectionString);
            _connection.Open();
            _profilesService = new SQLProfilesService(connectionString);
            _resultsService  = new SQLResultsServiceServer(connectionString);

            PrepareQueries();
        }
示例#17
0
 public StudentsController(
     UserManager <ApplicationUser> userManager,
     IResultsService resultService,
     IEventsService eventsService,
     IDateTimeConverter dateTimeConverter)
 {
     this.userManager       = userManager;
     this.resultService     = resultService;
     this.eventsService     = eventsService;
     this.dateTimeConverter = dateTimeConverter;
 }
示例#18
0
        public ResultsServiceTests()
        {
            logger               = A.Fake <ILogger <ResultsService> >();
            resultsApiService    = A.Fake <IResultsApiService>();
            sessionService       = A.Fake <ISessionService>();
            jPOverviewAPIService = A.Fake <IJpOverviewApiService>();
            resultsService       = new ResultsService(logger, resultsApiService, jPOverviewAPIService, sessionService);

            sessionId = "session1";
            A.CallTo(() => sessionService.GetSessionId()).Returns(sessionId);
        }
        public OnDeleteCalculationResults(
            ILogger logger,
            IResultsService resultsService,
            IMessengerService messengerService,
            IUserProfileProvider userProfileProvider, bool useAzureStorage = false)
            : base(logger, messengerService, FunctionName, QueueName, useAzureStorage, userProfileProvider, resultsService)
        {
            Guard.ArgumentNotNull(resultsService, nameof(resultsService));

            _resultsService = resultsService;
        }
示例#20
0
        public OnProviderResultsSpecificationCleanup(
            ILogger logger,
            IResultsService resultsService,
            ICorrelationIdProvider correlationIdProvider)
        {
            Guard.ArgumentNotNull(logger, nameof(logger));
            Guard.ArgumentNotNull(resultsService, nameof(resultsService));
            Guard.ArgumentNotNull(correlationIdProvider, nameof(correlationIdProvider));

            _logger = logger;
            _correlationIdProvider = correlationIdProvider;
            _resultsService        = resultsService;
        }
示例#21
0
 public ScuService(
     ILogger <ScuService> logger,
     IPayloads iPayloads,
     IResultsService resultsService,
     IHostApplicationLifetime appLifetime,
     IOptions <DicomAdapterConfiguration> dicomAdapterConfiguration)
 {
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _payloadsApi = iPayloads ?? throw new ArgumentNullException(nameof(iPayloads));
     _appLifetime = appLifetime ?? throw new ArgumentNullException(nameof(appLifetime));
     _dicomAdapterConfiguration = dicomAdapterConfiguration ?? throw new ArgumentNullException(nameof(dicomAdapterConfiguration));
     _watcher = new ExportTaskWatcher(logger, resultsService, dicomAdapterConfiguration.Value.Dicom.Scu);
 }
示例#22
0
 public QuizesController(
     IQuizesService quizService,
     IResultsService resultsService,
     IWebHostEnvironment webHostEnvironment,
     UserManager <ApplicationUser> userManager,
     Cloudinary cloudinary)
 {
     this.quizService        = quizService;
     this.resultsService     = resultsService;
     this.userManager        = userManager;
     this.cloudinary         = cloudinary;
     this.webHostEnvironment = webHostEnvironment;
 }
示例#23
0
        public Game(IResultsService resultsService,
                    IRoundService roundService,
                    IPlayerService playerService,
                    IMessageService messageService)
        {
            _resultsService = resultsService;
            _roundService   = roundService;
            _playerService  = playerService;
            _messageService = messageService;

            GeneratePlayers();
            rounds = (new Round[noOfRounds]).Select((e, i) => e = new Round(players, _roundService, i + 1)).ToArray();
        }
示例#24
0
        public OutputJob(TaskResponse task, ILogger <ScuService> logger, IResultsService iResultsService, DestinationApplicationEntity destination)
        {
            CopyBaseProperties(task);
            Logger         = logger ?? throw new ArgumentNullException(nameof(logger));
            resultsService = iResultsService ?? throw new ArgumentNullException(nameof(iResultsService));

            AeTitle = destination.AeTitle;
            HostIp  = destination.HostIp;
            Port    = destination.Port;

            FailedDicomFiles    = new Dictionary <DicomFile, string>();
            FailedFiles         = new List <string>();
            ProcessedDicomFiles = new List <DicomFile>();
            PendingDicomFiles   = new Queue <DicomFile>();
        }
示例#25
0
        public void Open(string databasePath, string databaseOptions, string mmeCode = null)
        {
            if (!String.IsNullOrWhiteSpace(databasePath))
            {
                var connectionString = $"data source={databasePath};{databaseOptions}";
                _profilesService = new SQLiteProfilesService(connectionString);
                _resultsService  = new SQLiteResultsServiceLocal(connectionString);
                _syncService     = new SyncService(connectionString, mmeCode);

                m_Connection = new SQLiteConnection(connectionString, false);
                m_Connection.Open();

                PrepareWriteCommands();
                PrepareReadCommands();
            }
        }
示例#26
0
        public ResultsController(
            IResultsService resultsService,
            IProviderCalculationResultsSearchService providerCalculationResultsSearchService,
            IProviderCalculationResultsReIndexerService providerCalculationResultsReIndexerService,
            ISpecificationsWithProviderResultsService specificationsWithProviderResultsService)
        {
            Guard.ArgumentNotNull(resultsService, nameof(resultsService));
            Guard.ArgumentNotNull(providerCalculationResultsSearchService, nameof(providerCalculationResultsSearchService));
            Guard.ArgumentNotNull(providerCalculationResultsReIndexerService, nameof(providerCalculationResultsReIndexerService));
            Guard.ArgumentNotNull(specificationsWithProviderResultsService, nameof(specificationsWithProviderResultsService));

            _resultsService = resultsService;
            _providerCalculationResultsSearchService    = providerCalculationResultsSearchService;
            _providerCalculationResultsReIndexerService = providerCalculationResultsReIndexerService;
            _specificationsWithProviderResultsService   = specificationsWithProviderResultsService;
        }
示例#27
0
 public QuizzesController(
     IResultHelper resultHelper,
     IShuffler shuffler,
     UserManager <ApplicationUser> userManager,
     IQuizzesService quizService,
     IResultsService resultService,
     IDistributedCache distributedCache,
     IQuestionsService questionsService)
 {
     this.resultHelper     = resultHelper;
     this.shuffler         = shuffler;
     this.userManager      = userManager;
     this.quizService      = quizService;
     this.resultService    = resultService;
     this.distributedCache = distributedCache;
     this.questionsService = questionsService;
 }
示例#28
0
        public ScuExportService(
            ILogger <ScuExportService> logger,
            IPayloads payloadsApi,
            IResultsService resultsService,
            IServiceScopeFactory serviceScopeFactory,
            IOptions <DicomAdapterConfiguration> dicomAdapterConfiguration,
            IStorageInfoProvider storageInfoProvider)
            : base(logger, dicomAdapterConfiguration, serviceScopeFactory, storageInfoProvider)
        {
            if (dicomAdapterConfiguration is null)
            {
                throw new ArgumentNullException(nameof(dicomAdapterConfiguration));
            }

            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory));
            _scuConfiguration    = dicomAdapterConfiguration.Value.Dicom.Scu;
            Agent        = _scuConfiguration.AeTitle;
            Concurrentcy = _scuConfiguration.MaximumNumberOfAssociations;
        }
示例#29
0
 public ResultsController(IResultsService service, ILoggingService logger)
 {
     this.service = service;
     this.logger  = logger;
 }
 public ResultsController(IResultsService resultService)
 {
     this._resultService = resultService;
 }