Exemple #1
0
 public AccountController(UserManager <AppUser> userMgr, SignInManager <AppUser> siginMgr, ISendEmail emailSender, IUnitOfWork unitOfWork)
 {
     userManager   = userMgr;
     signInManager = siginMgr;
     _emailSender  = emailSender;
     _unitOfWork   = unitOfWork;
 }
Exemple #2
0
 public AccountServiceTest()
 {
     _stubAccountRepository = MockRepository.GenerateStub <IAccountRepository>();
     mockmail = MockRepository.GenerateMock <ISendEmail>();
     logData  = MockRepository.GenerateMock <ILogData>();
     sut      = new AccountService(mockmail, _stubAccountRepository, logData, new ChatContext());
 }
Exemple #3
0
 public AccountService(ISendEmail SendEmail, IAccountRepository accountRepository, ILogData LogData, ChatContext ctx)
 {
     _sendEmail         = SendEmail;
     _accountRepository = accountRepository;
     _chatContext       = ctx;
     _logData           = LogData;
 }
Exemple #4
0
 public AccountController(
     SignInManager <IdentityUser> signInManager,
     UserManager <IdentityUser> userManager,
     IHostingEnvironment env,
     IIdentityServerInteractionService interaction,
     IHttpContextAccessor httpContextAccessor,
     ISendEmail emailSender,
     IOptions <TransactionalTemplateConfiguration> transactionalTemplateConfiguration,
     ILogger <AccountController> logger,
     IOptions <LockoutSettings> lockoutSettings,
     ITrackTelemetry trackTelemetry,
     IOptions <MessageConstants> messageConstants,
     IRegisterService registerService,
     IFailedLoginAttemptsService failedLoginAttemptsService)
 {
     _signInManager = signInManager ?? throw new ArgumentNullException(nameof(signInManager));
     _userManager   = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _emailSender   = emailSender ?? throw new ArgumentNullException(nameof(emailSender));
     _transactionalTemplateConfiguration = transactionalTemplateConfiguration?.Value
                                           ?? throw new ArgumentNullException(nameof(transactionalTemplateConfiguration));
     _logger                     = logger ?? throw new ArgumentNullException(nameof(logger));
     _lockoutSettings            = lockoutSettings?.Value ?? throw new ArgumentNullException(nameof(lockoutSettings));
     _account                    = new AccountService(interaction, httpContextAccessor);
     _trackTelemetry             = trackTelemetry ?? throw new ArgumentNullException(nameof(trackTelemetry));
     _messageConstants           = messageConstants.Value;
     _registerService            = registerService;
     _failedLoginAttemptsService = failedLoginAttemptsService;
 }
Exemple #5
0
 public PaymentsController(GymTestContext context, ISendEmail sendEmail, IPaymentLogic payLogic, IOptionsSnapshot <AppSettings> app)
 {
     _context      = context;
     _appSettings  = app;
     _sendEmail    = sendEmail;
     _paymentLogic = payLogic;
 }
 public AssistanceLogicImpl(GymTestContext context, IOptionsSnapshot <AppSettings> app, ISendEmail sendEmail, ITimezoneLogic timeZone)
 {
     _appSettings = app;
     _context     = context;
     _sendEmail   = sendEmail;
     _timeZone    = timeZone;
 }
 public JobListingController(IEnumerable <IGenerateEmail> emailGenerators, ISendEmail sendEmail, IValidateResume resumeValidator, IRecaptchaService recaptchaService)
 {
     _emailGenerators  = emailGenerators;
     _sendEmail        = sendEmail;
     _resumeValidator  = resumeValidator;
     _recaptchaService = recaptchaService;
 }
Exemple #8
0
 public SendEmailService(IUserInfoRepository userInfoRepository, ISendEmail sendEmail, ICompiler compiler, IEmailTemplate template)
 {
     _userInfoRepository = userInfoRepository;
     _sendEmail          = sendEmail;
     _compiler           = compiler;
     _template           = template;
 }
Exemple #9
0
 public PracticeController(IEnumerable <IGenerateEmail> emailGenerators, ISendEmail sendEmail,
                           IRecaptchaService reCaptchaService)
 {
     _emailGenerators  = emailGenerators;
     _sendEmail        = sendEmail;
     _reCaptchaService = reCaptchaService;
 }
Exemple #10
0
 public void SetUp()
 {
     _inventoryService = Mock.Create <ICheckInventory>();
     _paymentProvider  = Mock.Create <IPaymentProvider>();
     _sendEmailService = Mock.Create <ISendEmail>();
     _cart             = new Cart(_inventoryService, _paymentProvider, _sendEmailService);
 }
        public void Given()
        {
            emailSender = A.Fake <ISendEmail>();
            var sut = new CustomerService(emailSender, A.Fake <ICustomerRepository>());

            sut.SendEmailToAllCustomers();
        }
Exemple #12
0
 public AccountServiceTest()
 {
     _chatContext       = new ChatContext();
     _sendEmailStub     = MockRepository.GenerateStub <ISendEmail>();
     _logDataStub       = MockRepository.GenerateStub <ILogData>();
     _accountRepository = new AccountRepository(_chatContext);
     _sut = new AccountService(_sendEmailStub, _accountRepository, _logDataStub, new ChatContext());
 }
 public PaymentNotificationLogicImpl(GymTestContext context, IOptionsSnapshot <AppSettings> app, ISendEmail sendEmail, ILogger <IPaymentLogic> logger, ITimezoneLogic timeZone)
 {
     _appSettings = app;
     _context     = context;
     _sendEmail   = sendEmail;
     _logger      = logger;
     _timeZone    = timeZone;
 }
 public void Given()
 {
     emailSender = A.Fake<ISendEmail>();
     var customerRepository = A.Fake<ICustomerRepository>();
     A.CallTo(() => customerRepository.GetAllCustomers()).Returns(new List<Customer> { new Customer { Email = customersEmail }});
     var sut = new CustomerService(emailSender, customerRepository);
     sut.SendEmailToAllCustomers();
 }
Exemple #15
0
 public Cart(ICheckInventory inventoryService,
             IPaymentProvider paymentProvider,
             ISendEmail sendEmailService)
 {
     this._sendEmailService = sendEmailService;
     this._paymentProvider  = paymentProvider;
     this._inventoryService = inventoryService;
 }
Exemple #16
0
 public IndexModel(ISendEmail sendEmail, IUserService userService,
                   IAzureSASTokenUrl azureSASTokenUrl, ILogger <IndexModel> logger)
 {
     _sendEmail        = sendEmail;
     _userService      = userService;
     _azureSASTokenUrl = azureSASTokenUrl;
     _logger           = logger;
 }
Exemple #17
0
 public UserReportController(GymTestContext context, ISendEmail sendEmail, IHostingEnvironment env, IOptionsSnapshot <AppSettings> app, UserManager <IdentityUser> userManager)
 {
     _userManager = userManager;
     _context     = context;
     _sendEmail   = sendEmail;
     _env         = env;
     _appSettings = app;
 }
 public ConfirmationEmailSender(ISendEmail emailSender,
                                ILogger <ConfirmationEmailSender> logger,
                                IOptions <SiteConfiguration> settings)
 {
     _emailSender = emailSender;
     _logger      = logger;
     _config      = Guard.Against.Null(settings.Value, nameof(settings));
 }
Exemple #19
0
 public HomeController(UserManager <AppUser> userManager, ITasksRepository tasksRepo, ISuggestionRepository suggestionRepo, IUnitOfWork _unitOfWork, ISendEmail emailSender, IHttpContextAccessor httpContextAccessor)
 {
     unitOfWork           = _unitOfWork;
     tasksRepository      = tasksRepo;
     suggestionRepository = suggestionRepo;
     _userManager         = userManager;
     _emailSender         = emailSender;
     _httpContextAccessor = httpContextAccessor;
 }
 public InvitationService(
     IRepository<Data.Securable> securableRepo,
     IRepository<Data.Invitation> invitationRepo,
     ISendEmail emailSender)
 {
     _securableRepo = securableRepo;
     _invitationRepo = invitationRepo;
     _emailSender = emailSender;
 }
 public void Given()
 {
     emailSender = A.Fake<ISendEmail>();
     customers = new List<Customer> { new Customer { Email ="*****@*****.**", IsPreferred = true } };
     customerRepository = A.Fake<ICustomerRepository>();
     A.CallTo(() => customerRepository.GetAllCustomers()).Returns(customers);
     var sut = new CustomerService(emailSender, customerRepository);
     sut.SendEmailToPreferredCustomers();
 }
Exemple #22
0
 public InvitationService(
     IRepository <Data.Securable> securableRepo,
     IRepository <Data.Invitation> invitationRepo,
     ISendEmail emailSender)
 {
     _securableRepo  = securableRepo;
     _invitationRepo = invitationRepo;
     _emailSender    = emailSender;
 }
Exemple #23
0
 public DefaultController(UserManager <User> userManager, SignInManager <User> signInManager, ITokenService tokenService,
                          ISendEmail sendEmail, IUsersData userData)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _tokenService  = tokenService;
     _sendEmail     = sendEmail;
     _userData      = userData;
 }
Exemple #24
0
        public TeacherController(ISendEmail send,
                                 ITeacherService teacherService)
        {
            this.teacherService = new TeacherService();
            this.send           = send;

            ///  this.send = send;
            // send = new SendEmail();
        }
Exemple #25
0
 public CashMovementController(GymTestContext context, ISendEmail sendEmail, IHostingEnvironment env, IOptionsSnapshot <AppSettings> app, UserManager <IdentityUser> userManager, ILogger <IPaymentLogic> logger, ITimezoneLogic timeZone)
 {
     _logger      = logger;
     _userManager = userManager;
     _context     = context;
     _sendEmail   = sendEmail;
     _env         = env;
     _appSettings = app;
     _timeZone    = timeZone;
 }
 public NotificationController(/*INotificationRepository notificationRepository,*/
     IMapper mapper,
     IAuthRepository authRepository,
     ISendEmail sendEmail)
 {
     _authRepository = authRepository;
     //_notificationRepository = notificationRepository;
     _mapper = mapper;
     _sendEmailRepository = sendEmail;
 }
Exemple #27
0
 public HomeController(
     ILogger <HomeController> logger,
     ISendEmail emailSender,
     IOptions <SiteConfiguration> siteConfigOptions
     )
 {
     //_producingService = producingService;
     _logger      = logger;
     _emailSender = emailSender;
     _siteConfig  = siteConfigOptions.Value;
 }
 public AccountController(IMapper mapper,
     IAuthRepository authRepository,
     ISendEmail sendEmail,
     IAccountDetailRepository accountDetailRepository,
     IFriendsRepository friendsRepository)
 {
     _mapper = mapper;
     _authRepository = authRepository;
     _emailService = sendEmail;
     _accountDetailRepository = accountDetailRepository;
     _friendsRepository = friendsRepository;
 }
            public void Given()
            {
                emailSender = A.Fake <ISendEmail>();

                var customerRepository = A.Fake <ICustomerRepository>();

                A.CallTo((() => customerRepository.GetAllCustomers())).Returns(new List <Customer>());

                var sut = new CustomerService(emailSender, customerRepository);

                sut.SendEmailToAllCustomers();
            }
Exemple #30
0
        public void Given()
        {
            emailSender = A.Fake <ISendEmail>();
            customers   = new List <Customer> {
                new Customer {
                    Email = "*****@*****.**", IsPreferred = true
                }
            };
            customerRepository = A.Fake <ICustomerRepository>();
            A.CallTo(() => customerRepository.GetAllCustomers()).Returns(customers);
            var sut = new CustomerService(emailSender, customerRepository);

            sut.SendEmailToPreferredCustomers();
        }
 public AccountController(
     UserManager <ApplicationUser> userManager
     , IMapper autoMapper
     , ILoggerManager logger
     , SignInManager <ApplicationUser> signInManager
     , ISendEmail sendEmail
     )
 {
     _autoMapper    = autoMapper;
     _userManager   = userManager;
     _logger        = logger;
     _signInManager = signInManager;
     _sendEmail     = sendEmail;
 }
Exemple #32
0
 public FriendsController(IAuthRepository authRepository,
                          IMapper mapper,
                          IAccountDetailRepository accountDetailRepository,
                          IFriendsRepository friendsRepository,
                          ISearchRepository searchRepository,
                          ISendEmail sendEmail)
 {
     _authRepository          = authRepository;
     _accountDetailRepository = accountDetailRepository;
     _mapper              = mapper;
     _friendsRepository   = friendsRepository;
     _searchRepository    = searchRepository;
     _sendEmailRepository = sendEmail;
 }
Exemple #33
0
 public AuthController(IConfiguration config,
                       IMapper mapper,
                       //LockoutOptions lockoutOptions,
                       UserManager <User> userManager,
                       SignInManager <User> signInManager,
                       ISendEmail sendEmail)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     //_lockoutOptions = lockoutOptions;
     _mapper    = mapper;
     _config    = config;
     _sendEmail = sendEmail;
 }
        public void Given()
        {
            customers = new List<Customer>
            {
                new Customer { Email = "*****@*****.**" },
                new Customer { Email = "*****@*****.**" }
            };

            emailSender = A.Fake<ISendEmail>();
            var customerRepository = A.Fake<ICustomerRepository>();
            A.CallTo(() => customerRepository.GetAllCustomersWithOrderTotalsOfOneHundredOrGreater()).Returns(customers);

            var sut = A.Fake<PromotionalEmailService>(x => x.WithArgumentsForConstructor(() => new PromotionalEmailService(customerRepository, emailSender)));
            A.CallTo(sut).Where(x => x.Method.Name == "get_FromEmailAddress").WithReturnType<string>().Returns(fromAddress);
            sut.SendEmail(subject, body);
        }
Exemple #35
0
        /// 
        /// </summary>
        /// <param name="article"></param>
        public static void AddSendEmail(ISendEmail email)
        {
            // Create the Database object, using the default database service. The
            // default database service is determined through configuration.
            Database db = DatabaseFactory.CreateDatabase();

            string sqlCommand = "InsertEmailToSend";
            DbCommand commentaryCommand = db.GetStoredProcCommand(sqlCommand);

            // GlobalFunctions.GetCurrentTimeInEST()

            db.AddInParameter(commentaryCommand, "EmailDescription", DbType.String, email.EmailDescription);
            db.AddInParameter(commentaryCommand, "IsEmailSent", DbType.Boolean, email.IsEmailSent);
            db.AddInParameter(commentaryCommand, "EmailDateTime", DbType.DateTime, GlobalFunctions.GetCurrentTimeInEST());
            db.AddInParameter(commentaryCommand, "EmailSubject", DbType.String, email.EmailSubject);
            db.AddInParameter(commentaryCommand, "IsSubscribers", DbType.Boolean, email.IsSubscribers);

            using (DbConnection connection = db.CreateConnection())
            {
                connection.Open();
                db.ExecuteNonQuery(commentaryCommand);
                connection.Close();
            }
        }
 public void SetUp()
 {
     _mockIQueryUsersByEmail = Mock.Create<IQueryUsersByEmail>();
     _mockEmailSender = Mock.Create<ISendEmail>();
 }
 public AvailabilityController()
 {
     _requestRepository = new RequestRepository();
     _emailSender = new SesEmailSender();
 }
 public ContactController(ISendEmail sendEmail)
 {
     _sendEmail = sendEmail;
 }
 public RequestsController()
 {
     _requestRepository = new RequestRepository();
     _emailSender = new SesEmailSender();
 }
 public CustomerService(ISendEmail emailSender, ICustomerRepository customerRepository, IProvideNewGuids guidProvider)
 {
     this.emailSender = emailSender;
     this.customerRepository = customerRepository;
     this.guidProvider = guidProvider;
 }
 public PromotionalEmailService(ICustomerRepository customerRepository, ISendEmail emailProvider)
     : base(emailProvider)
 {
     this.customerRepository = customerRepository;
 }
 public HomeController(ISendEmail sendEmail)
 {
     this.sendEmail = sendEmail;
 }
            public void Given()
            {
                emailSender = A.Fake<ISendEmail>();
                var sut = new HomeController(emailSender);
                sut.ControllerContext = new ControllerContext(new RequestContext(A.Fake<HttpContextBase>(), new RouteData()), sut);

                var principal = A.Fake<IPrincipal>();
                var identity = new GenericIdentity(userName);
                A.CallTo(() => principal.Identity).Returns(identity);
                A.CallTo(() => sut.ControllerContext.HttpContext.User).Returns(principal);

                sut.SendCustomerEmail(emailAddress);
            }
 public CustomerService(ISendEmail emailSender, ICustomerRepository customerRepository)
 {
     this.emailSender = emailSender;
     this.customerRepository = customerRepository;
 }
 public void Given()
 {
     emailSender = A.Fake<ISendEmail>();
     var sut = new CustomerService(emailSender, A.Fake<ICustomerRepository>());
     sut.SendEmailToAllCustomers();
 }
 protected EmailBase(ISendEmail emailProvider)
 {
     this.emailProvider = emailProvider;
 }
 public NotificationService(IQueryUsersByEmail queryUsersByEmail, ISendEmail emailSender)
 {
     _queryUsersByEmail = queryUsersByEmail;
     _emailSender = emailSender;
 }