Esempio n. 1
0
        public async Task NotifyTriangleTasks_HasTasksToNotify_Notify()
        {
            IEmailService    emailService    = A.Fake <IEmailService>();
            IWorkTaskService workTaskService = A.Fake <IWorkTaskService>();

            TaskTriangleBuilder taskTriangleBuilder = new TaskTriangleBuilder();
            TaskTriangle        taskTriangle        = taskTriangleBuilder.AddContent("content1")
                                                      .AddResource("resource1")
                                                      .AddPercentageProgressToNotify(60)
                                                      .SetTime("20/09/2020", DayPeriod.Noon, 4, halfWorkDay: true)
                                                      .Build();

            IWorkTask workTask = A.Fake <IWorkTask>();

            A.CallTo(() => workTask.TaskMeasurement).Returns(taskTriangle);

            List <IWorkTask> workTasks = new List <IWorkTask>()
            {
                workTask
            };

            A.CallTo(() => workTaskService.FindWorkTasksByConditionAsync(A <Func <IWorkTask, bool> > .Ignored))
            .Returns(workTasks);

            NotifierService notifierService = new NotifierService(
                emailService, workTaskService, NullLogger <NotifierService> .Instance);

            await notifierService.NotifyTriangleTasks().ConfigureAwait(false);

            A.CallTo(() => emailService.SendEmail(A <string> .Ignored)).MustHaveHappenedOnceExactly();
        }
Esempio n. 2
0
 public GeoDatabaseUpdatedHandler(
     ILogger <GeoDatabaseUpdatedHandler> logger,
     IMediator mediator,
     IRouteSegmentCommandFactory routeSegmentEventFactory,
     IRouteNodeCommandFactory routeNodeEventFactory,
     IGeoDatabase geoDatabase,
     IEventStore eventStore,
     IProducer producer,
     IOptions <KafkaSetting> kafkaSettings,
     IOptions <ApplicationSetting> applicationSettings,
     IModifiedGeometriesStore modifiedGeometriesStore,
     IRouteNodeInfoCommandFactory routeNodeInfoCommandFactory,
     IRouteSegmentInfoCommandFactory routeSegmentInfoCommandFactory,
     IValidationService validationService,
     IWorkTaskService workTaskService)
 {
     _logger   = logger;
     _mediator = mediator;
     _routeSegmentEventFactory = routeSegmentEventFactory;
     _routeNodeEventFactory    = routeNodeEventFactory;
     _geoDatabase                    = geoDatabase;
     _eventStore                     = eventStore;
     _producer                       = producer;
     _kafkaSettings                  = kafkaSettings.Value;
     _applicationSettings            = applicationSettings.Value;
     _modifiedGeometriesStore        = modifiedGeometriesStore;
     _routeNodeInfoCommandFactory    = routeNodeInfoCommandFactory;
     _routeSegmentInfoCommandFactory = routeSegmentInfoCommandFactory;
     _validationService              = validationService;
     _workTaskService                = workTaskService;
 }
Esempio n. 3
0
 public WorksController(IWorkTaskService workTaskService,
                        IContractLogService contractLogService,
                        CurrencySettings currencySettings,
                        ICurrencyService currencyService,
                        IWorkModelFactory workModelFactory,
                        ILocalizationService localizationService,
                        IPermissionService permissionService,
                        IWorkContext workContext,
                        ITaskModelFactory taskModelFactory,
                        IContractModelFactory contractModelFactory,
                        IContractService contractService,
                        GSConfig config,
                        IDataProvider dataProvider,
                        IProcuringAgencyService procuringAgencyService,
                        IDbContext dbContext,
                        IPriceFormatter priceFormatter
                        )
 {
     this._workModelFactory     = workModelFactory;
     this._contractLogService   = contractLogService;
     this._currencySettings     = currencySettings;
     this._localizationService  = localizationService;
     this._workTaskService      = workTaskService;
     this._permissionService    = permissionService;
     this._workContext          = workContext;
     this._taskModelFactory     = taskModelFactory;
     this._contractModelFactory = contractModelFactory;
     this._contractService      = contractService;
     this._currencyService      = currencyService;
     this._config                 = config;
     this._dataProvider           = dataProvider;
     this._procuringAgencyService = procuringAgencyService;
     this._dbContext              = dbContext;
     this._priceFormatter         = priceFormatter;
 }
Esempio n. 4
0
 public CaseLawUnitTaskChangeController(
     ICaseLawUnitTaskChangeService _service,
     IWorkTaskService _taskService)
 {
     this.service     = _service;
     this.taskService = _taskService;
 }
Esempio n. 5
0
 public WorkModelFactory(ICustomerService customerService,
                         IWorkTaskService workTaskService,
                         IUnitService unitService)
 {
     this._unitService     = unitService;
     this._workTaskService = workTaskService;
     this._customerService = customerService;
 }
Esempio n. 6
0
 public WorkTasksController(ITasksGroupService taskService, IWorkTaskService workTaskService,
                            IMapper mapper, ILogger <WorkTasksController> logger)
 {
     mTasksGroupService = taskService ?? throw new ArgumentNullException(nameof(taskService));
     mWorkTaskService   = workTaskService ?? throw new ArgumentNullException(nameof(workTaskService));
     mMapper            = mapper ?? throw new ArgumentNullException(nameof(mapper));
     mLogger            = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 7
0
 public NotifierService(IEmailService emailService,
                        IWorkTaskService workTaskService,
                        ILogger <NotifierService> logger)
 {
     mEmailService    = emailService ?? throw new ArgumentNullException(nameof(emailService));
     mWorkTaskService = workTaskService ?? throw new ArgumentNullException(nameof(workTaskService));
     mLogger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 8
0
 public SqlDatabaseConnector(
     IWorkTaskService workTaskService,
     IStateService stateService,
     IDatabaseIntegration[] databaseIntegrations
     )
 {
     _workTaskService      = workTaskService;
     _stateService         = stateService;
     _databaseIntegrations = databaseIntegrations.ToDictionary(x => x.GetType().Name);
 }
Esempio n. 9
0
 public WorkTaskController(ICommonService _commonService,
                           INomenclatureService _nomenclatureService,
                           ICourtOrganizationService _organizationService,
                           IWorkTaskService _workTaskService)
 {
     commonService       = _commonService;
     nomenclatureService = _nomenclatureService;
     organizationService = _organizationService;
     workTaskService     = _workTaskService;
 }
Esempio n. 10
0
 public NotesController(INoteService noteService,
                        IWorkTaskService workTaskService,
                        IMapper mapper,
                        ILogger <NotesController> logger)
 {
     mNoteService     = noteService ?? throw new ArgumentNullException(nameof(noteService));
     mWorkTaskService = workTaskService ?? throw new ArgumentNullException(nameof(workTaskService));
     mMapper          = mapper ?? throw new ArgumentNullException(nameof(mapper));
     mLogger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 11
0
 public WorkTaskUserController(IWorkTaskUserService workTaskUserService,
                               IWorkTaskService workTaskService,
                               IMapper <WorkTaskUserDto, WorkTaskUserViewModel> userModelMapper,
                               IMapper <WorkTaskDto, WorkTaskViewModel> taskModelMapper)
 {
     _userService     = workTaskUserService;
     _userModelMapper = userModelMapper;
     _taskService     = workTaskService;
     _taskModelMapper = taskModelMapper;
 }
Esempio n. 12
0
 public DocumentResolutionService(
     ILogger <DocumentResolutionService> _logger,
     IRepository _repo,
     IUserContext _userContext,
     ICounterService _counterService,
     IWorkTaskService _worktaskService)
 {
     logger          = _logger;
     repo            = _repo;
     userContext     = _userContext;
     counterService  = _counterService;
     worktaskService = _worktaskService;
 }
Esempio n. 13
0
 public DocumentResolutionController(
     IDocumentResolutionService _drService,
     INomenclatureService _nomService,
     ICommonService _commonService,
     ICdnService _cdnService,
     IWorkTaskService _taskService)
 {
     drService     = _drService;
     nomService    = _nomService;
     commonService = _commonService;
     cdnService    = _cdnService;
     taskService   = _taskService;
 }
Esempio n. 14
0
        public async Task ListTasksAsync_SuccessStatusCode()
        {
            List <IWorkTask> tasksList = new List <IWorkTask>();

            IWorkTaskService workTaskService = A.Fake <IWorkTaskService>();

            A.CallTo(() => workTaskService.ListAllAsync()).Returns(tasksList);

            using TestServer testServer        = ApiTestHelper.BuildTestServerWithFakes(workTaskService: workTaskService);
            using HttpClient httpClient        = testServer.CreateClient();
            using HttpResponseMessage response = await httpClient.GetAsync(MainRoute).ConfigureAwait(false);

            response.EnsureSuccessStatusCode();
        }
Esempio n. 15
0
        public async Task NotifyTriangleTasks_HasNoTasksToNotify_DoesNotNotify()
        {
            IEmailService    emailService    = A.Fake <IEmailService>();
            IWorkTaskService workTaskService = A.Fake <IWorkTaskService>();

            A.CallTo(() => workTaskService.FindWorkTasksByConditionAsync(A <Func <IWorkTask, bool> > .Ignored))
            .Returns(new List <IWorkTask>());

            NotifierService notifierService = new NotifierService(
                emailService, workTaskService, NullLogger <NotifierService> .Instance);

            await notifierService.NotifyTriangleTasks().ConfigureAwait(false);

            A.CallTo(() => emailService.SendEmail(A <string> .Ignored)).MustNotHaveHappened();
        }
Esempio n. 16
0
 public CalendarService(
     ILogger <DocumentService> _logger,
     IRepository _repo,
     IUserContext _userContext,
     IWorkTaskService _taskService,
     ICaseSessionService _caseSessionService,
     IUrlHelper _url)
 {
     logger             = _logger;
     repo               = _repo;
     userContext        = _userContext;
     urlHelper          = _url;
     taskService        = _taskService;
     caseSessionService = _caseSessionService;
 }
Esempio n. 17
0
 public WorkFileController(IPermissionService permissionService,
                           IContractService contractService,
                           IWorkTaskService workTaskService,
                           IWorkContext workContext,
                           IWorkFileService workfileService,
                           IGSFileProvider fileProvider
                           )
 {
     this._permissionService = permissionService;
     this._workTaskService   = workTaskService;
     this._contractService   = contractService;
     this._workContext       = workContext;
     this._workfileService   = workfileService;
     this._fileProvider      = fileProvider;
 }
Esempio n. 18
0
 public AppWorkController(
     IContractMonitorService contractMonitorService,
     IUnitService unitService,
     IConstructionModelFactory constructionModelFactory,
     IConstructionService constructionService,
     IPriceFormatter priceFormatter,
     IWorkTaskService workTaskService,
     ICustomerService customerService,
     IProcuringAgencyService procuringAgencyService,
     IContractLogService contractLogService,
     IContractTypeService contractTypeService,
     IContractFormService contractFormService,
     ICustomerActivityService customerActivityService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IPermissionService permissionService,
     ISettingService settingService,
     IContractModelFactory contractModelFactory,
     IWorkContext workContext,
     IContractService contractService,
     INotificationService notificationService,
     IPrivateMessagesModelFactory privateMessagesModelFactory
     )
 {
     this._contractMonitorService   = contractMonitorService;
     this._constructionModelFactory = constructionModelFactory;
     this._unitService                 = unitService;
     this._constructionService         = constructionService;
     this._priceFormatter              = priceFormatter;
     this._workTaskService             = workTaskService;
     this._customerService             = customerService;
     this._notificationService         = notificationService;
     this._privateMessagesModelFactory = privateMessagesModelFactory;
     this._contractTypeService         = contractTypeService;
     this._contractLogService          = contractLogService;
     this._contractFormService         = contractFormService;
     this._procuringAgencyService      = procuringAgencyService;
     this._contractModelFactory        = contractModelFactory;
     this._customerActivityService     = customerActivityService;
     this._localizationService         = localizationService;
     this._localizedEntityService      = localizedEntityService;
     this._permissionService           = permissionService;
     this._contractService             = contractService;
     this._workContext                 = workContext;
 }
Esempio n. 19
0
 public DocumentTemplateController(
     IDocumentTemplateService _service,
     IDocumentService _docService,
     INomenclatureService _nomService,
     ICdnService _cdnService,
     IWorkTaskService _taskService,
     ICommonService _commonService,
     IPrintDocumentService _printService
     )
 {
     service       = _service;
     docService    = _docService;
     nomService    = _nomService;
     cdnService    = _cdnService;
     taskService   = _taskService;
     commonService = _commonService;
     printService  = _printService;
 }
 public PaymentExpenditureController(
     IContractMonitorService contractMonitorService,
     IConstructionModelFactory constructionModelFactory,
     IConstructionService constructionService,
     IPriceFormatter priceFormatter,
     IWorkTaskService workTaskService,
     ICustomerService customerService,
     IProcuringAgencyService procuringAgencyService,
     IContractLogService contractLogService,
     IContractTypeService contractTypeService,
     IContractFormService contractFormService,
     ILocalizationService localizationService,
     ILocalizedEntityService localizedEntityService,
     IPermissionService permissionService,
     IContractModelFactory contractModelFactory,
     IWorkContext workContext,
     IContractService contractService,
     INotificationService notificationService,
     IPrivateMessagesModelFactory privateMessagesModelFactory,
     IUnitService unitService,
     IPaymentAdvanceFactory paymentAdvanceFactory,
     IPaymentAdvanceService paymentAdvanceService,
     IContractPaymentService contractPaymentService,
     ICurrencyService currencyService)
 {
     this._constructionService    = constructionService;
     this._priceFormatter         = priceFormatter;
     this._workTaskService        = workTaskService;
     this._customerService        = customerService;
     this._notificationService    = notificationService;
     this._contractLogService     = contractLogService;
     this._contractFormService    = contractFormService;
     this._contractModelFactory   = contractModelFactory;
     this._localizationService    = localizationService;
     this._localizedEntityService = localizedEntityService;
     this._permissionService      = permissionService;
     this._contractService        = contractService;
     this._workContext            = workContext;
     this._unitService            = unitService;
     this._paymentAdvanceFactory  = paymentAdvanceFactory;
     this._paymentAdvanceService  = paymentAdvanceService;
     this._contractPaymentService = contractPaymentService;
     this._currencyService        = currencyService;
 }
Esempio n. 21
0
        public async Task ListTasksAsync_NullListReturned_EmptyListReturned()
        {
            List <IWorkTask> tasksList = null;

            IWorkTaskService workTaskService = A.Fake <IWorkTaskService>();

            A.CallTo(() => workTaskService.ListAllAsync()).Returns(tasksList);

            using TestServer testServer        = ApiTestHelper.BuildTestServerWithFakes(workTaskService: workTaskService);
            using HttpClient httpClient        = testServer.CreateClient();
            using HttpResponseMessage response = await httpClient.GetAsync(MainRoute).ConfigureAwait(false);

            string stringResponse = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

            IEnumerable <WorkTaskResource> workTaskResources =
                JsonConvert.DeserializeObject <IEnumerable <WorkTaskResource> >(stringResponse);

            Assert.Empty(workTaskResources);
        }
Esempio n. 22
0
 public TaskModelFactory(ICurrencyService currencyService,
                         ITaskGroupService taskGroupService,
                         ICountryService countryService,
                         ILocalizationService localizationService,
                         IStateProvinceService stateProvinceService,
                         IStaticCacheManager cacheManager,
                         IWorkContext workContext,
                         IWorkTaskService workTaskService,
                         ICustomerService customerService,
                         IContractService contractService,
                         IContractPaymentService contractPaymentService,
                         IContractLogService contractLogService,
                         IUnitService unitService,
                         IPictureService pictureService,
                         MediaSettings mediaSettings,
                         IPriceFormatter priceFormatter,
                         IGenericAttributeService genericAttributeService,
                         IContractTypeService contractTypeService,
                         GSConfig config)
 {
     this._currencyService         = currencyService;
     this._taskGroupService        = taskGroupService;
     this._countryService          = countryService;
     this._localizationService     = localizationService;
     this._stateProvinceService    = stateProvinceService;
     this._cacheManager            = cacheManager;
     this._workContext             = workContext;
     this._workTaskService         = workTaskService;
     this._customerService         = customerService;
     this._contractPaymentService  = contractPaymentService;
     this._contractService         = contractService;
     this._contractLogService      = contractLogService;
     this._unitService             = unitService;
     this._pictureService          = pictureService;
     this._mediaSettings           = mediaSettings;
     this._genericAttributeService = genericAttributeService;
     this._priceFormatter          = priceFormatter;
     this._contractTypeService     = contractTypeService;
     this._config = config;
 }
Esempio n. 23
0
        public static TestServer BuildTestServerWithFakes(
            ITasksGroupService tasksGroupService = null,
            IWorkTaskService workTaskService     = null,
            INoteService noteService             = null,
            ICloudService cloudService           = null)
        {
            if (tasksGroupService == null)
            {
                tasksGroupService = A.Fake <ITasksGroupService>();
            }

            if (workTaskService == null)
            {
                workTaskService = A.Fake <IWorkTaskService>();
            }

            if (noteService == null)
            {
                noteService = A.Fake <INoteService>();
            }

            if (cloudService == null)
            {
                cloudService = A.Fake <ICloudService>();
            }

            TestServer testServer = new TestServer(WebHost.CreateDefaultBuilder()
                                                   .ConfigureTestServices(sc =>
            {
                sc.AddSingleton(tasksGroupService);
                sc.AddSingleton(workTaskService);
                sc.AddSingleton(noteService);
                sc.AddSingleton(cloudService);
            })
                                                   .UseStartup <Startup>()
                                                   .UseEnvironment("Development"));

            return(testServer);
        }
        // GET: /WorkTask/


        public WorkTaskController(IWorkTaskService workTaskService)
        {
            this.WorkTaskService = workTaskService;
        }
 public AuthenticationService(HttpClient httpClient, IWorkTaskService workTaskService)
 {
     _httpClient      = httpClient;
     _workTaskService = workTaskService;
 }
Esempio n. 26
0
 public WorkTaskController(IWorkTaskService workTaskService,
                           IMapper <WorkTaskDto, WorkTaskViewModel> taskModelMapper)
 {
     _workTaskService = workTaskService;
     _taskModelMapper = taskModelMapper;
 }
Esempio n. 27
0
 public HomeController(IWorkTaskService _workTaskService, IStringLocalizer strlocalize)
 {
     workTaskService = _workTaskService;
     _localizer      = strlocalize;
 }
Esempio n. 28
0
 public CustomAuthenticationStateProvider(ILocalStorageService localStorageService, HttpClient http, IWorkTaskService workTaskService)
 {
     _localStorageService = localStorageService;
     _http            = http;
     _workTaskService = workTaskService;
 }
Esempio n. 29
0
 public MyTasksComponent(IWorkTaskService _workTaskService, IUserContext _userContext)
 {
     workTaskService = _workTaskService;
     userContext     = _userContext;
 }
Esempio n. 30
0
 public WfController(IWorkTaskService service, ISchedulerFactory schedulerFactory, QuartzStart quart)
 {
     _service = service;
     this._schedulerFactory = schedulerFactory;
     _quart = quart;
 }