Beispiel #1
0
        public void TestInitializer()
        {
            var uow = Substitute.For <IUnitOfWork2>();

            _bookOfficesDbSet = Substitute.For <DbSet <BookOffice>, IQueryable <BookOffice>, IDbAsyncEnumerable <BookOffice> >();
            uow.GetDbSet <BookOffice>().Returns(_bookOfficesDbSet);

            _bookLogsDbSet = Substitute.For <DbSet <BookLog>, IQueryable <BookLog>, IDbAsyncEnumerable <BookLog> >();
            uow.GetDbSet <BookLog>().Returns(_bookLogsDbSet);

            _booksDbSet = Substitute.For <DbSet <Book>, IQueryable <Book>, IDbAsyncEnumerable <Book> >();
            uow.GetDbSet <Book>().Returns(_booksDbSet);

            _officesDbSet = Substitute.For <DbSet <Office>, IQueryable <Office>, IDbAsyncEnumerable <Office> >();
            uow.GetDbSet <Office>().Returns(_officesDbSet);

            _userDbSet = Substitute.For <DbSet <ApplicationUser>, IQueryable <ApplicationUser>, IDbAsyncEnumerable <ApplicationUser> >();
            uow.GetDbSet <ApplicationUser>().Returns(_userDbSet);

            _appSettings          = Substitute.For <IApplicationSettings>();
            _validationService    = Substitute.For <IBookMobileServiceValidator>();
            _bookInfoService      = Substitute.For <IBookInfoService>();
            _roleService          = Substitute.For <IRoleService>();
            _userService          = Substitute.For <IUserService>();
            _mailingService       = Substitute.For <IMailingService>();
            _mailTemplate         = Substitute.For <IMailTemplate>();
            _organizationService  = Substitute.For <IOrganizationService>();
            _bookServiceValidator = new BookServiceValidator();
            var asyncRunner = Substitute.For <IAsyncRunner>();

            _bookService = new BookService(uow, _appSettings, _roleService, _userService, _mailingService, _mailTemplate, _organizationService, _bookInfoService, _bookServiceValidator,
                                           _validationService, asyncRunner);
        }
Beispiel #2
0
 public AddToCartController(IUserService userServices, IHostingEnvironment appEnvironment, IMailingService mailingService, UserManager <ApplicationUser> userManager)
 {
     _appEnvironment = appEnvironment;
     _userServices   = userServices;
     _userManager    = userManager;
     _mailingService = mailingService;
 }
Beispiel #3
0
        public StatisticService(
            IStatisticRepository statisticRepository, IAccountService accountService, StatisticManager statisticManager,
            Dictionary <string, IMt4MySqlRepository> repositories, IClientService clientServise, IService Service,
            IMailingService mailingService, ISignalService signalService, StatisticCalculator calculator, ICacheService cacheService
            )
        {
            try
            {
                ratesServer = ConfigurationManager.AppSettings["RatesServer"];
                this.statisticRepository           = statisticRepository;
                this.accountService                = accountService;
                this.clientService                 = clientServise;
                this.statisticManager              = statisticManager;
                this.mt4Repositories               = repositories;
                this.Service                       = Service;
                this.mailingService                = mailingService;
                this.cacheService                  = cacheService;
                this.signalService                 = signalService;
                statisticManager.StatisticUpdated += StatisticUpdated;

                FirstUpdatingStatistics();

#if !DEBUG
                UpdateOpenTradesRatio();
                UpdateActivities(Constants.ActivitiesCachingAmount);
#endif
            }
            catch (Exception ex)
            {
                Logger.Fatal("Fatal error at init: {0}", ex.ToString());
                throw;
            }
        }
Beispiel #4
0
        protected JwtController(
            IAuthenticationService authenticationService,
            IRoleService roleService,
            IPersonService personService,
            IMailingService mailingService,
            ILogger <JwtController> logger,
            string jwtKey,
            string jwtIssuer,
            string jwtAudience,
            string passwordResetSubject,
            string passwordResetTextBody,
            string passwordResetHtmlBody)
        {
            this.authenticationService = authenticationService ?? throw new ArgumentNullException(nameof(authenticationService));

            this.roleService = roleService ?? throw new ArgumentNullException(nameof(roleService));

            this.personService = personService ?? throw new ArgumentNullException(nameof(personService));

            this.mailingService = mailingService ?? throw new ArgumentNullException(nameof(mailingService));

            this.logger = logger ?? throw new ArgumentNullException(nameof(logger));

            this.jwtKey = jwtKey ?? throw new ArgumentNullException(nameof(jwtKey));

            this.jwtIssuer = jwtIssuer ?? throw new ArgumentNullException(nameof(jwtIssuer));

            this.jwtAudience = jwtAudience ?? throw new ArgumentNullException(nameof(jwtAudience));

            this.passwordResetSubject = passwordResetSubject ?? throw new ArgumentNullException(nameof(passwordResetSubject));

            this.passwordResetTextBody = passwordResetTextBody ?? throw new ArgumentNullException(nameof(passwordResetTextBody));

            this.passwordResetHtmlBody = passwordResetHtmlBody ?? throw new ArgumentNullException(nameof(passwordResetHtmlBody));
        }
Beispiel #5
0
 public OrdersController(
     IQuartetClientFactory                       clientFactory,
     IMappingService<Order,    OrderViewModel>   orderMapping,
     IMappingService<Customer, HCardViewModel>   hcardMapping,
     IMappingService<Address,  AddressViewModel> addressMapping,
     IMailingService                             mailingService,
     IInvoicingService                           invoicingService,
     IFeaturesConfigService                      featuresConfigService,
     IAppSettings                                appSettings,
     IConsultantContext                          consultantContext,
     IConsultantDataServiceClientFactory         consultantDataServiceClientFactory,
     IPromotionService                           promotionService,
     IProductCatalogClientFactory                productCatalogClientFactory,
     IInventoryService                           inventoryService,
     ISubsidiaryAccessor                         subsidiaryAccessor
 )
 {
     _clientFactory                      = clientFactory;
     _orderMapping                       = orderMapping;
     _hcardMapping                       = hcardMapping;
     _addressMapping                     = addressMapping;
     _mailingService                     = mailingService;
     _invoicingService                   = invoicingService;
     _featuresConfigService              = featuresConfigService;
     _appSettings                        = appSettings;
     _consultantContext                  = consultantContext;
     _consultantDataServiceClientFactory = consultantDataServiceClientFactory;
     _promotionService                   = promotionService;
     _productCatalogClientFactory        = productCatalogClientFactory;
     _inventoryService                   = inventoryService;
     _subsidiaryAccessor                 = subsidiaryAccessor;
 }
Beispiel #6
0
 public EmailController(
     IUserDataService userDataService,
     IMailingService mailingService)
 {
     _userDataService = userDataService;
     _mailingService  = mailingService;
 }
Beispiel #7
0
        public BookService(IUnitOfWork2 uow,
                           IApplicationSettings appSettings,
                           IRoleService roleService,
                           IUserService userService,
                           IMailingService mailingService,
                           IMailTemplate mailTemplate,
                           IOrganizationService organizationService,
                           IBookInfoService bookInfoService,
                           IBookServiceValidator bookServiceValidator,
                           IBookMobileServiceValidator bookMobileServiceValidator,
                           IAsyncRunner asyncRunner)
        {
            _uow                 = uow;
            _appSettings         = appSettings;
            _roleService         = roleService;
            _userService         = userService;
            _mailingService      = mailingService;
            _mailTemplate        = mailTemplate;
            _organizationService = organizationService;
            _booksDbSet          = uow.GetDbSet <Book>();
            _officesDbSet        = uow.GetDbSet <Office>();
            _bookLogsDbSet       = uow.GetDbSet <BookLog>();
            _userDbSet           = uow.GetDbSet <ApplicationUser>();
            _bookOfficesDbSet    = uow.GetDbSet <BookOffice>();

            _bookInfoService      = bookInfoService;
            _bookServiceValidator = bookServiceValidator;
            _serviceValidator     = bookMobileServiceValidator;
            _asyncRunner          = asyncRunner;
        }
Beispiel #8
0
 public ReportSender(IMailingService mailService, PersonManager <Admin> admManager, Employee empl, List <Page> pages)
 {
     _mailService  = mailService;
     _employee     = empl;
     _pages        = pages;
     _adminManager = admManager;
 }
Beispiel #9
0
        public CommentEmailNotificationService(IUnitOfWork2 uow,
                                               IUserService userService,
                                               ICommentService commentService,
                                               IMailTemplate mailTemplate,
                                               IMailingService mailingService,
                                               IApplicationSettings appSettings,
                                               IOrganizationService organizationService,
                                               IMarkdownConverter markdownConverter,
                                               IPostService postService,
                                               ILogger logger)
        {
            _appSettings         = appSettings;
            _userService         = userService;
            _commentService      = commentService;
            _mailTemplate        = mailTemplate;
            _mailingService      = mailingService;
            _organizationService = organizationService;
            _markdownConverter   = markdownConverter;
            _postService         = postService;
            _logger = logger;

            _eventsDbSet   = uow.GetDbSet <Event>();
            _projectsDbSet = uow.GetDbSet <Project>();
            _commentsDbSet = uow.GetDbSet <Comment>();
        }
Beispiel #10
0
 public ReviewCacheService(ILogger <ReviewCacheService> logger, IOptions <SMTPConnection> smtpConnection, IMailingService mailingService, IHostingEnvironment env)
 {
     _logger         = logger;
     _smtpConnection = smtpConnection;
     _mailingService = mailingService;
     _env            = env;
 }
Beispiel #11
0
 public UsersController(KMSDBContext context, IPasswordHasher <Users> passwordHasher, ISearchRepository search, IMailingService mail)
 {
     this._mail           = mail;
     this._db             = context;
     this._passwordHasher = passwordHasher;
     this._search         = search;
 }
 public DailyMailingService(IUnitOfWork2 unitOfWork, ISystemClock systemClock, IMailingService emailService)
 {
     _applicationUserDbSeb = unitOfWork.GetDbSet <ApplicationUser>();
     _postDbSet            = unitOfWork.GetDbSet <Post>();
     _systemClock          = systemClock;
     _emailService         = emailService;
 }
Beispiel #13
0
 public ServiceManager(ILogger <ServiceManager> logger, IServiceProviderRepository serviceProviderRepository, IUserRepository userRepository, INetworkService networkService, IMailingService mailingService)
 {
     this.logger = logger;
     this.serviceProviderRepository = serviceProviderRepository;
     this.userRepository            = userRepository;
     this.networkService            = networkService;
     this.mailingService            = mailingService;
 }
Beispiel #14
0
 public AccountController(IUserService userService, SignInManager <ApplicationUser> signInManager, IHostingEnvironment appEnvironment, IMailingService mailingService,
                          UserManager <ApplicationUser> userManager) : base(userManager)
 {
     _appEnvironment = appEnvironment;
     _userService    = userService;
     _mailingService = mailingService;
     _signInManager  = signInManager;
 }
 public HomeController(ILogger <HomeController> logger, IMediator mediator, ITemplateService templateService, IPdfService pdfService, IMailingService mailingService, IWebHostEnvironment environment)
 {
     _logger          = logger;
     _mediator        = mediator;
     _templateService = templateService;
     _pdfService      = pdfService;
     _mailingService  = mailingService;
     _environment     = environment;
 }
Beispiel #16
0
 public EventCalendarService(IUnitOfWork2 uow, IMailingService mailingService, IApplicationSettings appSettings, IEventValidationService eventValidationService)
 {
     _usersDbSet             = uow.GetDbSet <ApplicationUser>();
     _eventsDbSet            = uow.GetDbSet <Event>();
     _organizationsDbSet     = uow.GetDbSet <Organization>();
     _mailingService         = mailingService;
     _appSettings            = appSettings;
     _eventValidationService = eventValidationService;
 }
Beispiel #17
0
 public ResetPasswordRequestHandler(
     UserManager <User> userManager,
     IMailingService mailingService,
     FrontendOptions frontendOptions)
 {
     this.userManager     = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.mailingService  = mailingService ?? throw new ArgumentNullException(nameof(mailingService));
     this.frontendOptions = frontendOptions ?? throw new ArgumentNullException(nameof(frontendOptions));
 }
Beispiel #18
0
        public KudosNotificationService(IUnitOfWork2 uow, IMailingService mailingService, IApplicationSettings appSettings, IMailTemplate mailTemplate)
        {
            _appSettings    = appSettings;
            _mailTemplate   = mailTemplate;
            _mailingService = mailingService;

            _usersDbSet         = uow.GetDbSet <ApplicationUser>();
            _organizationsDbSet = uow.GetDbSet <Organization>();
        }
Beispiel #19
0
 public UserController(
     IUserManagementService userManagementService,
     IUserDataService userDataService,
     IMailingService mailingService)
 {
     _userManagementService = userManagementService;
     _userDataService       = userDataService;
     _mailingService        = mailingService;
 }
Beispiel #20
0
 public SubscriptionsController(ISubscriptionService subscriptionService,
                                IMailingService mailingService,
                                ITopicsService topicsService,
                                ILogger <SubscriptionsController> logger)
 {
     this.topicsService       = topicsService;
     this.subscriptionService = subscriptionService;
     this.mailingService      = mailingService;
     this.logger = logger;
 }
Beispiel #21
0
 public UsersController(IUserManager userManager,
                        IAuthorizer authorizer,
                        IMailingService mailingService,
                        IFileManager fileManager)
 {
     _userManager    = userManager;
     _authorizer     = authorizer;
     _mailingService = mailingService;
     _fileManager    = fileManager;
 }
Beispiel #22
0
        public void Initialize()
        {
            this.subscriptionService = Substitute.For <ISubscriptionService>();
            this.mailingService      = Substitute.For <IMailingService>();
            this.topicsService       = Substitute.For <ITopicsService>();
            this.logger = Substitute.For <ILogger <SubscriptionsController> >();

            this.cut = new SubscriptionsController(this.subscriptionService, this.mailingService, this.topicsService, this.logger);
            this.MockControllerContext(requestScheme, requestHost);
        }
 public BookRemindService(IUnitOfWork2 uow, IOrganizationService organizationService, IApplicationSettings appSettings, IUserService userService, IMailTemplate mailTemplate, IMailingService mailingService, ILogger logger)
 {
     _userService         = userService;
     _organizationService = organizationService;
     _appSettings         = appSettings;
     _mailTemplate        = mailTemplate;
     _mailingService      = mailingService;
     _booksDbSet          = uow.GetDbSet <BookLog>();
     _logger = logger;
 }
Beispiel #24
0
 public RecoverPasswordViewModel(
     IUsersRepository usersRepository,
     IMailingService mailingService,
     ILoginService loginService,
     LongRunningOperationHelper longRunningOperationHelper)
 {
     _usersRepository            = usersRepository;
     _mailingService             = mailingService;
     _loginService               = loginService;
     _longRunningOperationHelper = longRunningOperationHelper;
 }
Beispiel #25
0
 public UserService(
     IOptions <AppSettings> appSettings,
     UsersContext context,
     IMailingService mailingService,
     IMailProvider mailProvider)
 {
     _appSettings    = appSettings.Value;
     _context        = context;
     _mailingService = mailingService;
     _mailProvider   = mailProvider;
 }
 public OrderAdminController(
     IOrderRepository orderRepository,
     IMailingService mailingRepository,
     IUnitOfWork unitOfWork,
     IAppUserManager userManager,
     IMapper mapper)
     : base(unitOfWork, userManager, mapper)
 {
     _orderRepository   = orderRepository;
     _mailingRepository = mailingRepository;
     _logger            = LogManager.GetCurrentClassLogger();
 }
Beispiel #27
0
 public AdministrationUsersNotificationService(IUnitOfWork2 uow,
                                               IMailingService mailingService,
                                               IApplicationSettings appSettings,
                                               IMailTemplate mailTemplate,
                                               IUserService permissionService)
 {
     _organizationDbSet = uow.GetDbSet <Organization>();
     _mailingService    = mailingService;
     _mailTemplate      = mailTemplate;
     _appSettings       = appSettings;
     _userService       = permissionService;
 }
 public HomeController(
     IRepository <Category> categoryRepository,
     IProductRepository productRepository,
     IMailingService mailingRepository,
     IMapper mapper)
     : base(mapper)
 {
     _categoryRepository = categoryRepository;
     _productRepository  = productRepository;
     _mailingRepository  = mailingRepository;
     _logger             = LogManager.GetCurrentClassLogger();
 }
Beispiel #29
0
 public CommitteeNotificationService(IUnitOfWork2 uow,
                                     IMailTemplate mailTemplate,
                                     IApplicationSettings appSettings,
                                     IMailingService mailingService)
 {
     _organizationDbSet = uow.GetDbSet <Organization>();
     _mailTemplate      = mailTemplate;
     _appSettings       = appSettings;
     _mailingService    = mailingService;
     _committeeDbSet    = uow.GetDbSet <CommitteeEntity>();
     _suggestionDbSet   = uow.GetDbSet <CommitteeSuggestion>();
 }
 public SettingsAdminController(
     ISettingsRepository settingsRepository,
     IMailingService mailingRepository,
     IUnitOfWork unitOfWork,
     IAppUserManager userManager,
     IMapper mapper)
     : base(unitOfWork, userManager, mapper)
 {
     _settingsRepository = settingsRepository;
     _mailingRepository  = mailingRepository;
     _logger             = LogManager.GetCurrentClassLogger();
 }
Beispiel #31
0
 public static void Start(IMailingService mailingService, ILogger logger)
 {
     m_sender = mailingService;
     m_sender.IgnoreQueue(); //doesn't add message to queue
     m_logger         = logger;
     m_backgrndWorker = new Thread(BackgrndAction)
     {
         IsBackground = true
     };                         //setting thread action
     m_maxSendTries = 3;
     StartBackgrndProcessing(); //starts listener
 }
        public AuthModule(UserRepository userRepository, IMailingService mailingService, IResourcesTemplateService resourcesTemplateService)
        {
            _userRepository = userRepository;
            _mailingService = mailingService;
            _resourcesTemplateService = resourcesTemplateService;
            Get["/Auth/Login"] = x => View["Login"];
            Post["/Auth/Login"] = Login;

            Get["/Auth/Register"] = x => View["Login", new { IsRegister = true}];
            Post["/Auth/Register"] = Register;

            Get["/Auth/RecoverPassword"] = RecoverPassword;
            Get["/Auth/AskPassword"] = AskPassword;
            Post["/Auth/ChangePassword"] = ChangePassword;
        }
Beispiel #33
0
 public ImportCustomer(
     IConfigService configService,
     IQuartetClientFactory clientFactory,
     IAppSettings appSettings,
     IConsultantContext consultantContext,
     IMappingService<UploadedCustomer, ImportedCustomer> customerMappingService,
     IFacebookAuthentication fbAuth,
     IMailingService emailService
 )
 {
     _configService          = configService;
     _quartetClientFactory   = clientFactory;
     _appSettings            = appSettings;
     _consultantContext      = consultantContext;
     _customerMappingService = customerMappingService;
     _fbAuth                 = fbAuth;
     _emailService           = emailService;
 }
 public ContactUsController(IMailingService mailingService)
 {
     _mailingService = mailingService;
 }
Beispiel #35
0
 public EmailNotification(IMailingService mailing, IEmailNotificationRequiredSpecification specification)
 {
     _mailing = mailing;
     _specification = specification;
 }
Beispiel #36
0
 public CustomersController(
     IAppSettings appSettings,
     IQuartetClientFactory clientFactory,
     IConsultantContext consultantContext,
     IMappingService<Customer, CustomerDetailViewModel> customerMappingService,
     IMailingService emailService,
     IFeaturesConfigService featuresConfig
 )
 {
     _appSettings       = appSettings;
     _clientFactory     = clientFactory;
     _consultantContext = consultantContext;
     _emailService	   = emailService;
     _featuresConfig    = featuresConfig;
 }