public UserModuleTest() : base() { _userModule = serviceProvider.GetService <IUserModule>(); _stringConstant = serviceProvider.GetService <IStringConstant>(); _mockHttpClientService = serviceProvider.GetService <Mock <IHttpClientService> >(); Initialize(); }
public UserController(IUserRepository userRepository, UserManager <ApplicationUser> userManager, IStringConstant stringConstant, IProjectRepository projectRepository) { _userRepository = userRepository; _userManager = userManager; _stringConstant = stringConstant; _projectRepository = projectRepository; }
public ProjectTests() : base() { _projectRepository = serviceProvider.GetService <IProjectRepository>(); _dataRepository = serviceProvider.GetService <IDataRepository <Project, PromactOauthDbContext> >(); _dataRepositoryProjectUser = serviceProvider.GetService <IDataRepository <ProjectUser, PromactOauthDbContext> >(); _stringConstant = serviceProvider.GetService <IStringConstant>(); _userRepository = serviceProvider.GetService <IUserRepository>(); }
public AccountController(IAccountRepository iAccountRepository, IStringConstant iStringConstant, IEmailSender iEmailSender, IConfiguration configuration, ILogManagement iLogManagement) { _iAccountRepository = iAccountRepository; _iStringConstant = iStringConstant; _iEmailSender = iEmailSender; Configuration = configuration; _iLogManagement = iLogManagement; }
public RoleRepository(telebilling_v01Context dbTeleBilling_V01Context, IMapper mapper, IStringConstant iStringConstant , ILogManagement ilogManagement) { _dbTeleBilling_V01Context = dbTeleBilling_V01Context; _iStringConstant = iStringConstant; _mapper = mapper; _iLogManagement = ilogManagement; }
public DashboardRepository(telebilling_v01Context dbTeleBilling_V01Context, IStringConstant iStringConstant, ILogManagement iLogManagement, IMapper mapper) { _dbTeleBilling_V01Context = dbTeleBilling_V01Context; _iStringConstant = iStringConstant; _iLogManagement = iLogManagement; _mapper = mapper; }
public ExcelMappingRepository(telebilling_v01Context dbTeleBilling_V01Context, IMapper mapper, IStringConstant iStringConstant , ILogManagement ilogManagement, IStaticDataRepository iStaticRepository) { _dbTeleBilling_V01Context = dbTeleBilling_V01Context; _iStringConstant = iStringConstant; _mapper = mapper; _iLogManagement = ilogManagement; _iStaticRepository = iStaticRepository; }
public UserRepositoryTest() : base() { _userRepository = serviceProvider.GetService <IUserRepository>(); _userManager = serviceProvider.GetService <UserManager <ApplicationUser> >(); _mapper = serviceProvider.GetService <IMapper>(); _stringConstant = serviceProvider.GetService <IStringConstant>(); _projectRepository = serviceProvider.GetService <IProjectRepository>(); _mockEmailService = serviceProvider.GetService <Mock <IEmailSender> >(); }
public CustomConsentService(IIdentityServerInteractionService interaction, IClientStore clientStore, IResourceStore resourceStore, ILogger <CustomConsentService> logger, IStringConstant stringConstant) { _interaction = interaction; _clientStore = clientStore; _resourceStore = resourceStore; _logger = logger; _stringConstant = stringConstant; }
public BillMemoRepository(telebilling_v01Context dbTeleBilling_V01Context, IMapper mapper, IStringConstant iStringConstant , ILogManagement ilogManagement, IEmailSender iEmailSender) { _dbTeleBilling_V01Context = dbTeleBilling_V01Context; _iStringConstant = iStringConstant; _mapper = mapper; _iLogManagement = ilogManagement; _iEmailSender = iEmailSender; }
public ProjectRepository(IDataRepository <Project, PromactOauthDbContext> projectDataRepository, IDataRepository <ProjectUser, PromactOauthDbContext> projectUserDataRepository, IDataRepository <ApplicationUser, PromactOauthDbContext> userDataRepository, UserManager <ApplicationUser> userManager, IMapper mapperContext, IStringConstant stringConstant, ILogger <ProjectRepository> logger) { _projectDataRepository = projectDataRepository; _projectUserDataRepository = projectUserDataRepository; _userDataRepository = userDataRepository; _mapperContext = mapperContext; _userManager = userManager; _stringConstant = stringConstant; }
public AccountController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IEmailSender emailSender, ILoggerFactory loggerFactory, IHostingEnvironment hostingEnvironment, IStringConstant stringConstant, IOptionsMonitor <StringLiteral> stringLiterals) { _userManager = userManager; _hostingEnvironment = hostingEnvironment; _signInManager = signInManager; _emailSender = emailSender; _logger = loggerFactory.CreateLogger <AccountController>(); _stringConstant = stringConstant; _stringLiterals = stringLiterals.CurrentValue; }
public UserRepository(IDataRepository <ApplicationUser, PromactOauthDbContext> applicationUserDataRepository, RoleManager <IdentityRole> roleManager, UserManager <ApplicationUser> userManager, IEmailSender emailSender, IMapper mapperContext, IDataRepository <ProjectUser, PromactOauthDbContext> projectUserRepository, IProjectRepository projectRepository, IOptions <AppSettingUtil> appSettingUtil, IDataRepository <Project, PromactOauthDbContext> projectDataRepository, IStringConstant stringConstant, IDataRepository <ProjectUser, PromactOauthDbContext> projectUserDataRepository, IEmailUtil emailUtil) { _applicationUserDataRepository = applicationUserDataRepository; _userManager = userManager; _emailSender = emailSender; _mapperContext = mapperContext; _projectUserRepository = projectUserRepository; _projectRepository = projectRepository; _roleManager = roleManager; _projectDataRepository = projectDataRepository; _appSettingUtil = appSettingUtil; _stringConstant = stringConstant; _projectUserDataRepository = projectUserDataRepository; _emailUtil = emailUtil; }
public UserController(IUserRepository userRepository, UserManager <ApplicationUser> userManager, IStringConstant stringConstant) { _userRepository = userRepository; _userManager = userManager; _stringConstant = stringConstant; }
public DefaultApiResources(IStringConstant stringConstant) { _stringConstant = stringConstant; }
public LogManagement(telebilling_v01Context dbTeleBilling_V01Context, IStringConstant iStringConstant) { _dbTeleBilling_V01Context = dbTeleBilling_V01Context; _iStringConstant = iStringConstant; }
public AccountRepository(IConfiguration config, IStringConstant iStringConstant) { _config = config; _iStringConstant = iStringConstant; }
public ProjectController(IProjectRepository projectRepository, UserManager <ApplicationUser> userManager, IStringConstant stringConstant) { _projectRepository = projectRepository; _userManager = userManager; _stringConstant = stringConstant; }
public SendGridEmailSender(IOptions <SendGridAPI> sendGridAPI, IStringConstant stringConstant, ILogger <AuthMessageSender> logger) { _sendGridAPI = sendGridAPI; _stringConstant = stringConstant; _logger = logger; }
public HttpClientService(IStringConstant stringConstant) { _stringConstant = stringConstant; }
public EmailUtil(IHostingEnvironment hostingEnvironment, IStringConstant stringConstant, ILoggerFactory loggerFactory) { _logger = loggerFactory.CreateLogger <EmailUtil>(); _hostingEnvironment = hostingEnvironment; _stringConstant = stringConstant; }
public BaseProvider() { var randomString = Guid.NewGuid().ToString(); _mapperConfiguration = new MapperConfiguration(cfg => { cfg.AddProfile(new AutoMapperProfileConfiguration()); }); var services = new ServiceCollection(); services.AddEntityFrameworkInMemoryDatabase(); services.Configure <AppSettingUtil>(x => { x.CasualLeave = 14; x.PromactErpUrl = "http://www.example.com"; x.PromactOAuthUrl = "http://www.example.com"; x.SickLeave = 7; }); services.Configure <StringLiteral>(y => { y.Account = new Account(); y.Account.EmailNotExists = "Email does not exist"; y.Account.SuccessfullySendMail = "We have sent you a link on {{emailaddress}} to reset password.Please check your email."; y.ConsumerApp = new ConsumerApp(); y.ConsumerApp.CapitalAlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; y.ConsumerApp.AlphaNumericString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; }); services.AddIdentity <ApplicationUser, IdentityRole>() .AddEntityFrameworkStores <PromactOauthDbContext>() .AddDefaultTokenProviders(); services.AddScoped <IEnsureSeedData, EnsureSeedData>(); services.AddScoped <IUserRepository, UserRepository>(); services.AddScoped <IProjectRepository, ProjectRepository>(); services.AddScoped <IConsumerAppRepository, ConsumerAppRepository>(); services.AddScoped <IStringConstant, StringConstant>(); services.AddScoped(typeof(IDataRepository <,>), typeof(DataRepository <,>)); //Register Mapper services.AddSingleton <IMapper>(sp => _mapperConfiguration.CreateMapper()); services.AddTransient <IEmailSender, AuthMessageSender>(); services.AddDbContext <PromactOauthDbContext>(options => options.UseInMemoryDatabase(randomString), ServiceLifetime.Transient); // register IdentityServer4 dependencies services.AddScoped <ConfigurationStoreOptions>(); var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name; Action <DbContextOptionsBuilder> dbContextOptionsAction = (builder => builder.UseInMemoryDatabase(randomString)); services.AddDbContext <ConfigurationDbContext>(dbContextOptionsAction); services.AddTransient <IClientStore, ClientStore>(); services.AddTransient <IResourceStore, ResourceStore>(); services.AddTransient <ICorsPolicyService, CorsPolicyService>(); // Http Client mocking var httpClientMock = new Mock <IHttpClientService>(); var httpClientMockObject = httpClientMock.Object; services.AddScoped(x => httpClientMock); services.AddScoped(x => httpClientMockObject); // Http Context mocking var authenticationManagerMock = new Mock <AuthenticationManager>(); var httpContextMock = new Mock <HttpContext>(); httpContextMock.Setup(x => x.Authentication).Returns(authenticationManagerMock.Object); var httpContextAccessorMock = new Mock <IHttpContextAccessor>(); httpContextAccessorMock.Setup(x => x.HttpContext).Returns(httpContextMock.Object); var httpContextMockObject = httpContextAccessorMock.Object; services.AddScoped(x => httpContextAccessorMock); services.AddScoped(x => httpContextMockObject); services.AddScoped(x => httpClientMockObject); //Register email service mock var emailServiceMock = new Mock <IEmailSender>(); var emailServiceMockObject = emailServiceMock.Object; services.AddScoped(x => emailServiceMock); services.AddScoped(x => emailServiceMockObject); //Register email util mock var emailUtilMock = new Mock <IEmailUtil>(); var emailUtilMockObject = emailUtilMock.Object; services.AddScoped(x => emailUtilMock); services.AddScoped(x => emailUtilMockObject); serviceProvider = services.BuildServiceProvider(); RoleSeedFake(serviceProvider); //mock SendEmail and GetEmailTemplateForUserDetail methods _emailUtilMock = serviceProvider.GetService <Mock <IEmailUtil> >(); _mockEmailService = serviceProvider.GetService <Mock <IEmailSender> >(); _stringConstant = serviceProvider.GetService <IStringConstant>(); _userRepository = serviceProvider.GetService <IUserRepository>(); _mockEmailService.Setup(x => x.SendEmail(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())); _emailUtilMock.Setup(x => x.GetEmailTemplateForUserDetail(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>())); }
public HomeController(UserManager <ApplicationUser> userManager, IStringConstant stringConstant) { _userManager = userManager; _stringConstant = stringConstant; }
public AccountController(IConfiguration configuration, IAccountRepository accountRepository, IStringConstant iStringConstant) { _configuration = configuration; _accountRepository = accountRepository; _iStringConstant = iStringConstant; }
/// <summary> /// Constructor /// </summary> /// <param name="httpClient">Wrapper of http client</param> /// <param name="stringConstant">Wrapper of string constant</param> public ProjectModule(IHttpClientService httpClient, IStringConstant stringConstant) { _httpClient = httpClient; _stringConstant = stringConstant; }
public ConsumerAppRepositoryTest() : base() { _consumerAppRespository = serviceProvider.GetService <IConsumerAppRepository>(); _clientContext = serviceProvider.GetService <IDataRepository <IdentityServer4.EntityFramework.Entities.Client, ConfigurationDbContext> >(); _stringConstant = serviceProvider.GetService <IStringConstant>(); }
public SecurityHeadersAttribute(IStringConstant stringConstant) { _stringConstant = stringConstant; }
public AuthMessageSender(IOptions <EmailCrednetials> emailCrednetials, IStringConstant stringConstant) { _stringConstant = stringConstant; _emailCrednetials = emailCrednetials; }
public CustomProfileService(IUserClaimsPrincipalFactory <ApplicationUser> claimsFactory, UserManager <ApplicationUser> userManager, IStringConstant stringConstant) { _claimsFactory = claimsFactory; _userManager = userManager; _stringConstant = stringConstant; }