public ClientsController(
     ILoggerAdapter <ClientsController> logger,
     IMetricService metrics,
     IUserService userService,
     IClientService clientService
     ) : base(logger, metrics, userService)
 {
     _clientService = clientService;
 }
 public TimeSheetController(
     ILoggerAdapter <TimeSheetController> logger,
     IMetricService metrics,
     IUserService userService,
     ITimeSheetService timeSheetService)
     : base(logger, metrics, userService)
 {
     _timeSheetService = timeSheetService;
 }
 public FileTypeDetectionController(
     IGlasswallVersionService glasswallVersionService,
     IFileTypeDetector fileTypeDetector,
     IMetricService metricService,
     ILogger <FileTypeDetectionController> logger) : base(logger, metricService)
 {
     _glasswallVersionService = glasswallVersionService ?? throw new ArgumentNullException(nameof(glasswallVersionService));
     _fileTypeDetector        = fileTypeDetector ?? throw new ArgumentNullException(nameof(fileTypeDetector));
 }
        public MetricController(ICoreClientFactory clientFactory, IMetricService metricService)
        {
            if(clientFactory == null)
                throw new ArgumentNullException("clientFactory");
            if(metricService == null)
                throw new ArgumentNullException("metricService");

            _metricService = metricService;
        }
示例#5
0
 public MetricDataProcessor(
     IMetricService metricService,
     ISeriesService seriesService,
     ISeriesPointStore pointStore)
 {
     this.metricService = metricService ?? throw new ArgumentNullException(nameof(metricService));
     this.seriesService = seriesService ?? throw new ArgumentNullException(nameof(seriesService));
     this.pointStore    = pointStore ?? throw new ArgumentNullException(nameof(pointStore));
 }
示例#6
0
 public ProductsController(
     ILoggerAdapter <ProductsController> logger,
     IMetricService metrics,
     IUserService userService,
     IProductService productService
     ) : base(logger, metrics, userService)
 {
     _productService = productService;
 }
 public HealthController(
     ILogger <HealthController> logger,
     IGlasswallVersionService glasswallVersionService,
     IMetricService metricService)
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _glasswallVersionService = glasswallVersionService ?? throw new ArgumentNullException(nameof(glasswallVersionService));
     _metricService           = metricService ?? throw new ArgumentNullException(nameof(metricService));
 }
示例#8
0
 // Constructor
 protected BaseService(
     ILogger <TService> logger,
     IMetricService metricService,
     string serviceName)
 {
     Logger        = logger;
     MetricService = metricService;
     ServiceName   = serviceName;
 }
        public CandidateAccessTokenServiceTests()
        {
            _candidateId = Guid.NewGuid();
            _metrics     = new MetricService();
            var mockEnv = new Mock <IEnv>();

            mockEnv.Setup(m => m.TotpSecretKey).Returns("secret_key");
            _service = new CandidateAccessTokenService(mockEnv.Object, _metrics);
        }
示例#10
0
 public ProjectService(
     ILoggerAdapter <ProjectService> logger,
     IMetricService metrics,
     IProjectRepo projectRepo)
 {
     _projectRepo = projectRepo;
     _logger      = logger;
     _metrics     = metrics;
 }
示例#11
0
 public BaseController(
     ILoggerAdapter <TController> logger,
     IMetricService metrics,
     IUserService userService)
 {
     // TODO: [TESTS] (BaseController) Add tests
     Logger      = logger;
     Metrics     = metrics;
     UserService = userService;
 }
示例#12
0
 public HealthService(
     IDataContext context,
     ILogger <HealthService> logger,
     IMetricService metrics
     )
 {
     _context = context;
     _logger  = logger;
     _metrics = metrics;
 }
示例#13
0
 public DemoService(
     ILogger <DemoService> logger,
     IDataContext context,
     IMetricService metricService
     )
 {
     _logger        = logger;
     _context       = context;
     _metricService = metricService;
 }
示例#14
0
 public HomeController(
     IMetricService metricService,
     IDataContext context,
     IAuthService auth
     )
 {
     _metricService = metricService;
     _context       = context;
     _auth          = auth;
 }
示例#15
0
        public MetricResultViewModel(INavigationService navigationService) : base(navigationService)
        {
            _navigationService = navigationService;
            _metricService     = new MetricService();
            _nurseService      = new NurseService();
            _deviceService     = new DeviceService();
            _patientService    = new PatientService();

            SaveCommand = new DelegateCommand(Save);
        }
示例#16
0
 public PingService(
     IMetricService metrics,
     ILogger <PingService> logger,
     IHttpClientFactory httpClientFactory
     )
 {
     _factory = httpClientFactory;
     _logger  = logger;
     _metrics = metrics;
 }
 public ApiMetricsMiddleware(
     ILoggerAdapter <ApiMetricsMiddleware> logger,
     IMetricService metrics,
     IDateTimeAbstraction dateTime,
     RequestDelegate next)
 {
     _logger   = logger;
     _metrics  = metrics;
     _next     = next;
     _dateTime = dateTime;
 }
 public CrmSyncJob(
     IEnv env,
     IStore store,
     ILogger <CrmSyncJob> logger,
     IMetricService metrics)
     : base(env)
 {
     _store   = store;
     _logger  = logger;
     _metrics = metrics;
 }
示例#19
0
        public GraphiteApiModule(IMetricService metricService, IMetricRegistry metricRegistry, IMetricAggregator metricAggregator, ExpressionCompiler expressionCompiler) :
            base("/api/graphite/v1")
        {
            this.metricService      = metricService;
            this.metricRegistry     = metricRegistry;
            this.metricAggregator   = metricAggregator;
            this.expressionCompiler = expressionCompiler;

            Get["/metrics/find"] = Get["/metrics"] = Post["/metrics/find"] = Post["/metrics"] = QueryMetrics;
            Get["/render"]       = Post["/render"] = RenderSeries;
        }
示例#20
0
        /// <summary>
        /// Creates a new instance of ProcessedEventMetricCounter
        /// </summary>
        /// <param name="metrics"></param>
        /// <param name="pipelineId"></param>
        public ProcessedEventMetricCounter(IMetricService metrics, string pipelineId)
        {
            _metrics    = metrics;
            _pipelineId = pipelineId;

            _count = metrics.GetMetricValue <long>(MetricType.ProcessedEvents);
            if (_count == 0)
            {
                metrics.SetMetric(new Metric(MetricType.ProcessedEvents, "Processed Events", _count));
            }
        }
 public LocationSyncJob(
     IEnv env,
     GetIntoTeachingDbContext dbContext,
     ILogger <LocationSyncJob> logger,
     IMetricService metrics)
     : base(env)
 {
     _logger    = logger;
     _dbContext = dbContext;
     _metrics   = metrics;
 }
示例#22
0
文件: Bus.cs 项目: belczyk/Marcus.Bus
 public Bus(IServiceProvider serviceProvider
            , IBusSession sessionAccessor
            , ICommandsEventsStore commandsEventsStore
            , IMetricService metricService
            , ITime time)
 {
     ServiceProvider     = serviceProvider;
     SessionAccessor     = sessionAccessor;
     CommandsEventsStore = commandsEventsStore;
     MetricService       = metricService;
     Time = time;
 }
示例#23
0
 public RemotePingService(
     IMetricService metrics,
     ILogger <PingService> logger,
     IConfiguration conf,
     IHttpClientFactory factory
     )
 {
     _conf    = conf;
     _logger  = logger;
     _metrics = metrics;
     _factory = factory;
 }
示例#24
0
 public CrmSyncJob(
     IEnv env,
     IStore store,
     ILogger <CrmSyncJob> logger,
     IMetricService metrics,
     IAppSettings appSettings)
     : base(env)
 {
     _store       = store;
     _logger      = logger;
     _metrics     = metrics;
     _appSettings = appSettings;
 }
示例#25
0
 public DnsUpdateRunner(
     ILoggerAdapter <DnsUpdateRunner> logger,
     IHostIpAddressService addressService,
     IConfigService configService,
     IDnsUpdaterService dnsUpdater,
     IMetricService metrics)
 {
     _logger         = logger;
     _addressService = addressService;
     _configService  = configService;
     _dnsUpdater     = dnsUpdater;
     _metrics        = metrics;
 }
示例#26
0
 public AdminController(
     ILoggingService loggingService,
     ILogger <AdminController> logger,
     IMetricService metricService,
     IServiceProvider provider,
     ICleanService cleanService
     )
 {
     _metricService  = metricService;
     _logger         = logger;
     _loggingService = loggingService;
     _provider       = provider;
     _cleanService   = cleanService;
 }
示例#27
0
 public ProjectService(JazzMetricsContext db, IUserService userService, IProjectMetricService projectMetricService, IProjectUserService projectUserService,
                       IHelperService helperService, IHttpContextAccessor contextAccessor, IMetricService metricService, IJazzService jazzService, IProjectMetricSnapshotService projectMetricSnapshotService,
                       IMetricTypeService metricTypeService) : base(db)
 {
     _jazzService                  = jazzService;
     _userService                  = userService;
     _helperService                = helperService;
     _metricService                = metricService;
     _metricTypeService            = metricTypeService;
     _projectUserService           = projectUserService;
     _projectMetricService         = projectMetricService;
     _projectMetricSnapshotService = projectMetricSnapshotService;
     CurrentUser = helperService.GetCurrentUser(contextAccessor.HttpContext.User.GetId());
 }
 public TeachingEventsControllerTests()
 {
     _request = new ExistingCandidateRequest {
         Email = "*****@*****.**", FirstName = "John", LastName = "Doe"
     };
     _mockTokenService = new Mock <ICandidateAccessTokenService>();
     _mockCrm          = new Mock <ICrmService>();
     _mockStore        = new Mock <IStore>();
     _mockJobClient    = new Mock <IBackgroundJobClient>();
     _mockLogger       = new Mock <ILogger <TeachingEventsController> >();
     _metrics          = new MetricService();
     _controller       = new TeachingEventsController(_mockStore.Object, _mockJobClient.Object,
                                                      _mockTokenService.Object, _mockCrm.Object, _mockLogger.Object, _metrics);
 }
示例#29
0
 public HealthController(
     IMetricService metricService,
     IDataContext context,
     IAuthService auth,
     IBadgeService badge,
     IUptimeReportService uptime
     )
 {
     _metricService = metricService;
     _context       = context;
     _auth          = auth;
     _badge         = badge;
     _uptime        = uptime;
 }
        protected override void EstablishContext(MockRepository mocks)
        {
            //Prepare supplied data collections
            suppliedSchoolEntityGuid = new Guid("11111111-1111-1111-1111-111111111111");
            suppliedMetric  = new GranularMetric<int> {MetricId = 1, Name = "Supplied Metric"};

            //Set up the mocks
            domainEntityKeyResolver = mocks.StrictMock<IDomainEntityKeyResolver>();
            metricService = mocks.StrictMock<IMetricService>();

            //Set expectations
            Expect.Call(domainEntityKeyResolver.GetSchoolEntity(suppliedSchoolId)).Return(suppliedSchoolEntityGuid);
            Expect.Call(metricService.Get(suppliedSchoolEntityGuid, highSchoolGraduationPlanMetricNodeId)).Return(suppliedMetric);
        }
示例#31
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService            = metricService;
     this.focusService             = focusService;
     this.supportService           = supportService;
     this.updateService            = updateService;
     this.commentService           = commentService;
     this.userService          = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService    = goalStatusService;
     this.commentUserService   = commentUserService;
     this.updateSupportService = updateSupportService;
 }
示例#32
0
 public GoalController(IGoalService goalService, IMetricService metricService, IFocusService focusService, ISupportService supportService, IUpdateService updateService, ICommentService commentService, IUserService userService, ISecurityTokenService securityTokenService, ISupportInvitationService supportInvitationService, IGoalStatusService goalStatusService, ICommentUserService commentUserService, IUpdateSupportService updateSupportService)
 {
     this.goalService = goalService;
     this.supportInvitationService = supportInvitationService;
     this.metricService = metricService;
     this.focusService = focusService;
     this.supportService = supportService;
     this.updateService = updateService;
     this.commentService = commentService;
     this.userService = userService;
     this.securityTokenService = securityTokenService;
     this.goalStatusService = goalStatusService;
     this.commentUserService = commentUserService;
     this.updateSupportService = updateSupportService;
 }
示例#33
0
 public MagicLinkTokenGenerationJob(
     IEnv env,
     IBackgroundJobClient jobClient,
     ICandidateMagicLinkTokenService magicLinkTokenService,
     ICrmService crm,
     ILogger <MagicLinkTokenGenerationJob> logger,
     IMetricService metrics)
     : base(env)
 {
     _jobClient             = jobClient;
     _magicLinkTokenService = magicLinkTokenService;
     _crm     = crm;
     _logger  = logger;
     _metrics = metrics;
 }
示例#34
0
 public HomeController(IMetricService metricService, IFocusService focusService, IGoalService goalService, ICommentService commentService, IUpdateService updateService, ISupportService supportService, IUserService userService, IGroupUserService groupUserService, IGroupService groupService, IGroupGoalService groupGoalService, IGroupUpdateService groupupdateService, IGroupCommentService groupcommentService, IFollowUserService followUserService, IGroupUpdateUserService groupUpdateUserService, IGroupCommentUserService groupCommentUserService, ICommentUserService commentUserService)
 {
     this.metricService = metricService;
     this.focusService = focusService;
     this.goalService = goalService;
     this.commentService = commentService;
     this.updateService = updateService;
     this.supportService = supportService;
     this.userService = userService;
     this.groupService = groupService;
     this.groupUserService = groupUserService;
     this.groupGoalService = groupGoalService;
     this.groupupdateService = groupupdateService;
     this.groupcommentService = groupcommentService;
     this.followUserService = followUserService;
     this.groupCommentUserService = groupCommentUserService;
     this.groupUpdateUserService = groupUpdateUserService;
     this.commentUserService = commentUserService;
 }
示例#35
0
 public GroupController(IGroupService groupService, IGroupUserService groupUserService, IUserService userService, IMetricService metricService, IFocusService focusService, IGroupGoalService groupgoalService, IGroupInvitationService groupInvitationService, ISecurityTokenService securityTokenService, IGroupUpdateService groupUpdateService, IGroupCommentService groupCommentService, IGoalStatusService goalStatusService, IGroupRequestService groupRequestService, IFollowUserService followUserService, IGroupCommentUserService groupCommentUserService, IGroupUpdateSupportService groupUpdateSupportService, IGroupUpdateUserService groupUpdateUserService)
 {
     this.groupService = groupService;
     this.groupInvitationService = groupInvitationService;
     this.userService = userService;
     this.groupUserService = groupUserService;
     this.metricService = metricService;
     this.focusService = focusService;
     this.groupGoalService = groupgoalService; ;
     this.securityTokenService = securityTokenService;
     this.groupUpdateService = groupUpdateService;
     this.groupCommentService = groupCommentService;
     this.goalStatusService = goalStatusService;
     this.groupRequestService = groupRequestService;
     this.followUserService = followUserService;
     this.groupCommentUserService = groupCommentUserService;
     this.groupUpdateSupportService = groupUpdateSupportService;
     this.groupUpdateUserService = groupUpdateUserService;
 }
 public void SetUp()
 {
     _metricClient = MockRepository.GenerateMock<IMetricClient>();
     _clientFactory = MockRepository.GenerateMock<ICoreClientFactory>();
     _metricRepository = MockRepository.GenerateStub<IMetricRepository>();
     _service = new MetricService(_clientFactory, _metricRepository);
 }
示例#37
0
        public void SetUp()
        {
            groupRepository = new Mock<IGroupRepository>();
            followUserRepository = new Mock<IFollowUserRepository>();
            groupUserRepository = new Mock<IGroupUserRepository>();
            focusRepository = new Mock<IFocusRepository>();
            commentRepository = new Mock<ICommentRepository>();
            groupGoalRepository = new Mock<IGroupGoalRepository>();
            metricRepository = new Mock<IMetricRepository>();
            userRepository = new Mock<IUserRepository>();
            groupUdateRepository = new Mock<IGroupUpdateRepository>();
            updateUserRepository = new Mock<IGroupUpdateUserRepository>();
            groupCommentRepository = new Mock<IGroupCommentRepository>();
            groupCommentUserRepository = new Mock<IGroupCommentUserRepository>();
            groupInvitationRepository = new Mock<IGroupInvitationRepository>();
            groupRequestRepository = new Mock<IGroupRequestRepository>();
            goalStatusRepository = new Mock<IGoalStatusRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();
            groupUpdateSupportRepository = new Mock<IGroupUpdateSupportRepository>();
            groupUpdateUserRepository = new Mock<IGroupUpdateUserRepository>();

            unitOfWork = new Mock<IUnitOfWork>();
            controllerContext = new Mock<ControllerContext>();
            contextBase = new Mock<HttpContextBase>();
            // httpContext = new Mock<HttpContext>();
            httpRequest = new Mock<HttpRequestBase>();
            httpResponse = new Mock<HttpResponseBase>();
            genericPrincipal = new Mock<GenericPrincipal>();


            identity = new Mock<IIdentity>();
            principal = new Mock<IPrincipal>();



            groupService = new GroupService(groupRepository.Object, followUserRepository.Object, groupUserRepository.Object, unitOfWork.Object);
            focusService = new FocusService(focusRepository.Object, unitOfWork.Object);
            metricService = new MetricService(metricRepository.Object, unitOfWork.Object);
            groupgoalService = new GroupGoalService(groupGoalRepository.Object, unitOfWork.Object);
            groupUserService = new GroupUserService(groupUserRepository.Object, userRepository.Object, unitOfWork.Object);
            groupUpdateService = new GroupUpdateService(groupUdateRepository.Object, updateUserRepository.Object, groupGoalRepository.Object, unitOfWork.Object);
            groupCommentService = new GroupCommentService(groupCommentRepository.Object, groupCommentUserRepository.Object, groupUdateRepository.Object, unitOfWork.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
            groupInvitationService = new GroupInvitationService(groupInvitationRepository.Object, unitOfWork.Object);
            groupRequestService = new GroupRequestService(groupRequestRepository.Object, unitOfWork.Object);
            groupCommentUserService = new GroupCommentUserService(groupCommentUserRepository.Object, unitOfWork.Object, userRepository.Object);
            goalStatusService = new GoalStatusService(goalStatusRepository.Object, unitOfWork.Object);
            userProfileService = new UserProfileService(userProfileRepository.Object, unitOfWork.Object);
            groupUpdateSupportService = new GroupUpdateSupportService(groupUpdateSupportRepository.Object, unitOfWork.Object);
            groupUpdateUserService = new GroupUpdateUserService(groupUpdateUserRepository.Object, unitOfWork.Object, userRepository.Object);
        }
示例#38
0
        public void SetUp()
        {
            goalRepository = new Mock<IGoalRepository>();
            followuserRepository = new Mock<IFollowUserRepository>();
            supportRepository = new Mock<ISupportRepository>();
            goalStatusRepository = new Mock<IGoalStatusRepository>();
            focusRepository = new Mock<IFocusRepository>();
            metricRepository = new Mock<IMetricRepository>();
            updateRepository = new Mock<IUpdateRepository>();
            userRepository = new Mock<IUserRepository>();
            supportrepository = new Mock<ISupportRepository>();
            supportInvitationrepository = new Mock<ISupportInvitationRepository>();
            commentRepository = new Mock<ICommentRepository>();
            commentUserRepository = new Mock<ICommentUserRepository>();
            securityTokenrepository = new Mock<ISecurityTokenRepository>();
            userProfileRepository = new Mock<IUserProfileRepository>();
            updateSupportRepository = new Mock<IUpdateSupportRepository>();

            userMailer = new Mock<IUserMailer>();
            userMailerMock = new Mock<UserMailer>();
            mailerBase = new Mock<MailerBase>();
            unitOfWork = new Mock<IUnitOfWork>();

            goalService = new GoalService(goalRepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportService = new SupportService(supportRepository.Object, followuserRepository.Object, unitOfWork.Object);
            goalStatusService = new GoalStatusService(goalStatusRepository.Object, unitOfWork.Object);
            focusService = new FocusService(focusRepository.Object, unitOfWork.Object);
            metricService = new MetricService(metricRepository.Object, unitOfWork.Object);
            updateService = new UpdateService(updateRepository.Object, goalRepository.Object, unitOfWork.Object, followuserRepository.Object);
            userService = new UserService(userRepository.Object, unitOfWork.Object, userProfileRepository.Object);
            supportService = new SupportService(supportrepository.Object, followuserRepository.Object, unitOfWork.Object);
            supportInvitationService = new SupportInvitationService(supportInvitationrepository.Object, unitOfWork.Object);
            commentService = new CommentService(commentRepository.Object, commentUserRepository.Object, unitOfWork.Object, followuserRepository.Object);
            commentUserService = new CommentUserService(commentUserRepository.Object, userRepository.Object, unitOfWork.Object);
            securityTokenService = new SecurityTokenService(securityTokenrepository.Object, unitOfWork.Object);
            userProfileService = new UserProfileService(userProfileRepository.Object, unitOfWork.Object);
            updateSupportService = new UpdateSupportService(updateSupportRepository.Object, unitOfWork.Object);

            MailerBase.IsTestModeEnabled = true;
            userMailerMock.CallBase = true;

            controllerContext = new Mock<ControllerContext>();
            contextBase = new Mock<HttpContextBase>();
            httpRequest = new Mock<HttpRequestBase>();
            httpResponse = new Mock<HttpResponseBase>();
            genericPrincipal = new Mock<GenericPrincipal>();

            identity = new Mock<IIdentity>();
            principal = new Mock<IPrincipal>();
        }