コード例 #1
0
 public NotificationService(IRepository <Notification> notificationRepository, IContactService contactService,
                            IContactGroupService contactGroupService, INotificationTemplateService notificationTemplateService)
 {
     _notificationRepository      = notificationRepository;
     _contactGroupService         = contactGroupService;
     _notificationTemplateService = notificationTemplateService;
     _contactService = contactService;
 }
コード例 #2
0
 public NotificationsController(
     INotificationTemplateService notificationTemplateService,
     INotificationManager notificationManager,
     INotificationTemplateResolver eventTemplateResolver)
 {
     _notificationTemplateService = notificationTemplateService;
     _notificationManager = notificationManager;
     _eventTemplateResolver = eventTemplateResolver;
 }
コード例 #3
0
 public NotificationsController(
     INotificationTemplateService notificationTemplateService,
     INotificationManager notificationManager,
     INotificationTemplateResolver notificationTemplateResolver)
 {
     _notificationTemplateService  = notificationTemplateService;
     _notificationManager          = notificationManager;
     _notificationTemplateResolver = notificationTemplateResolver;
 }
コード例 #4
0
 public PlatformExportImportManager(ISecurityService securityService, IRoleManagementService roleManagementService, ISettingsManager settingsManager, IDynamicPropertyService dynamicPropertyService, IModuleCatalog moduleCatalog, ICacheManager <object> cacheManager, INotificationTemplateService notificationTemplateService)
 {
     _dynamicPropertyService      = dynamicPropertyService;
     _securityService             = securityService;
     _roleManagementService       = roleManagementService;
     _settingsManager             = settingsManager;
     _moduleCatalog               = moduleCatalog;
     _cacheManager                = cacheManager;
     _notificationTemplateService = notificationTemplateService;
     _manifestPartUri             = PackUriHelper.CreatePartUri(new Uri("Manifest.json", UriKind.Relative));
     _platformEntriesPartUri      = PackUriHelper.CreatePartUri(new Uri("PlatformEntries.json", UriKind.Relative));
 }
コード例 #5
0
        internal NotificationTemplateData RetrieveTemplateByType(NotificationTypes type)
        {
            ArgumentValidator.IsNotNull("type", type);

            INotificationTemplateService service = UnitOfWork.GetService <INotificationTemplateService>();
            var query = service.RetrieveByType(type);

            if (query.HasResult)
            {
                return(query.DataList.First());
            }

            return(null);
        }
コード例 #6
0
ファイル: NotificationController.cs プロジェクト: mrtcn/upope
 public NotificationController(
     IHubContext <NotificationHub, ITypedHubClient> hubContext,
     INotificationService notificationService,
     INotificationTemplateService notificationTemplateService,
     IIdentityService identityService,
     ILoyaltySyncService loyaltySyncService,
     IMapper mapper)
 {
     _hubContext                  = hubContext;
     _notificationService         = notificationService;
     _notificationTemplateService = notificationTemplateService;
     _identityService             = identityService;
     _loyaltySyncService          = loyaltySyncService;
     _mapper = mapper;
 }
        public void FindNotificationTemplateById_Service_Success()
        {
            // Arrange
            notificationTemplateService = new NotificationTemplateService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object);
            mockRepository.Setup(x => x.FindById <NotificationTemplate>(It.IsAny <int>())).Returns(new NotificationTemplate()).Verifiable();

            // Act
            var response = notificationTemplateService.FindNotificationTemplateById(It.IsAny <int>());

            // Assert
            Assert.IsNotNull(response);
            Assert.IsNotNull(response.Result);
            Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <NotificationTemplateDto>));
            mockRepository.Verify(x => x.FindById <NotificationTemplate>(It.IsAny <int>()), Times.Once);
        }
        public void DeleteNotificationTemplateById_Service_Fail()
        {
            // Arrange
            notificationTemplateService = new NotificationTemplateService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object);
            mockRepository.Setup(x => x.Delete <NotificationTemplate>(It.IsAny <int>())).Returns(false).Verifiable();

            // Act
            var response = notificationTemplateService.DeleteNotificationTemplate(It.IsAny <int>());

            // Assert
            Assert.IsNotNull(response);
            Assert.IsFalse(response.Result);
            Assert.IsTrue(response.Notifications.HasErrors());
            Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <bool>));
            mockRepository.Verify(x => x.Delete <NotificationTemplate>(It.IsAny <int>()), Times.Once);
        }
        public void GetAllNotificationTemplates_Service_Fail()
        {
            // Arrange
            notificationTemplateService = new NotificationTemplateService(mockRepository.Object, mockLogger.Object, mockCache.Object, mockTelemetry.Object);
            mockRepository.Setup(x => x.All <NotificationTemplate>()).Throws(new Exception()).Verifiable();

            // Act
            var response = notificationTemplateService.GetAllNotificationTemplates();

            // Assert
            Assert.IsNotNull(response);
            Assert.IsNull(response.Result);
            Assert.IsTrue(response.Notifications.HasErrors());
            Assert.IsInstanceOfType(response, typeof(GenericServiceResponse <IEnumerable <NotificationTemplateDto> >));
            mockRepository.Verify(x => x.All <NotificationTemplate>(), Times.Once);
        }
コード例 #10
0
 public NotificationTemplatesController(INotificationTemplateService service)
 {
     _service = service;
 }
コード例 #11
0
 public NotificationManager(INotificationTemplateResolver resolver, Func <IPlatformRepository> repositoryFactory, INotificationTemplateService notificationTemplateService)
 {
     _resolver                    = resolver;
     _repositoryFactory           = repositoryFactory;
     _notificationTemplateService = notificationTemplateService;
 }
コード例 #12
0
 public NotificationTemplatesController(INotificationTemplateService notificationTemplateService, IWidgetService widgetService)
 {
     _notificationTemplateService = notificationTemplateService;
     _widgetService = widgetService;
 }
コード例 #13
0
 public PlatformExportImportManager(ISecurityService securityService, IRoleManagementService roleManagementService, ISettingsManager settingsManager, IDynamicPropertyService dynamicPropertyService, IModuleCatalog moduleCatalog, ICacheManager<object> cacheManager, INotificationTemplateService notificationTemplateService)
 {
     _dynamicPropertyService = dynamicPropertyService;
     _securityService = securityService;
     _roleManagementService = roleManagementService;
     _settingsManager = settingsManager;
     _moduleCatalog = moduleCatalog;
     _cacheManager = cacheManager;
     _notificationTemplateService = notificationTemplateService;
     _manifestPartUri = PackUriHelper.CreatePartUri(new Uri("Manifest.json", UriKind.Relative));
     _platformEntriesPartUri = PackUriHelper.CreatePartUri(new Uri("PlatformEntries.json", UriKind.Relative));
 }
コード例 #14
0
        public NotificationTemplateSetupModel()
        {
            _notificationTemplateService = HostContainer.GetInstance <INotificationTemplateService>();

            Step = NotificationEnums.NotificationSetupStep.SetupNotificationTemplate;
        }
コード例 #15
0
 public NotificationSetupController(INotificationService notificationService, IContactService contactService, INotificationTemplateService notificationTemplateService)
 {
     _notificationService         = notificationService;
     _contactService              = contactService;
     _notificationTemplateService = notificationTemplateService;
 }
コード例 #16
0
 public HomeController(ILogger <HomeController> logger, INotificationTemplateService notificationTemplateService)
 {
     _logger = logger;
     this.notificationTemplateService = notificationTemplateService;
 }
コード例 #17
0
 public EmailNotificationService(IEmailClientProvider emailClientProvider, INotificationTemplateService notificationTemplateService)
 {
     _emailClientProvider         = emailClientProvider ?? throw new ArgumentNullException(nameof(emailClientProvider));
     _notificationTemplateService = notificationTemplateService ?? throw new ArgumentNullException(nameof(notificationTemplateService));
 }