private bool _disposedValue; // To detect redundant calls public GererMesCompteTestContext(PostScenarioCleaner cleaner) { Cleaner = cleaner; GmcClient = new GererMesComptesClient(h => new LoggingHandler(h)); GmcAccounts = new AccountInfoRepository(GmcClient); GmcOperations = new OperationsRepository(GmcClient); }
public AccountInfoTests() { var config = new MapperConfiguration(cfg => { cfg.AddProfile(new WebApi.Mappings.AutoMapper()); }); var mapper = config.CreateMapper(); IQueryable <Customer> customersData = new List <Customer> { new Customer { FirstName = "Rena", LastName = "Markiewitz", Email = "*****@*****.**", CustomerId = new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5"), Password = "******", Salt = "/PAaJXFGVGOxEWdGHv9TD+P6s9DaYmTws8ZMUkCp9Ow=" }, }.AsQueryable(); var accountsData = new List <Data.Entities.Account> { new Data.Entities.Account { AccountId = new Guid("9CFE55DF-65E2-4204-BAD5-08D82BD21687"), Balance = 1000000, Customer = customersData.FirstOrDefault(c => c.CustomerId == new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5")), OpenDate = Convert.ToDateTime("2020-07-19 13:03:43.4326053"), CustomerId = new Guid("E7775225-9C97-4460-D971-08D82BD1D7C5") }, }.AsQueryable(); var emailVerificationsData = new List <EmailVerification> { new EmailVerification { Email = "*****@*****.**", VerificationCode = 1234, ExpirationTime = DateTime.Now.AddDays(1) }, }.AsQueryable(); var context = new Mock <AccountContext>(); context.SetupGet(x => x.Customers).Returns(MockDBSetExtensions.GetDbSet(customersData).Object); context.SetupGet(x => x.Accounts).Returns(MockDBSetExtensions.GetDbSet(accountsData).Object); context.SetupGet(x => x.EmailVerifications).Returns(MockDBSetExtensions.GetDbSet(emailVerificationsData).Object); var accountInfoRepository = new AccountInfoRepository(context.Object, mapper); _service = new AccountInfoService(accountInfoRepository); }
public EmployeeService(EmployeeInfoRepository employeeInfoRepository , AccountInfoRepository accountInfoRepository , OrderInfoRepository orderInfoRepository) { _employeeInfoRepository = employeeInfoRepository; _accountInfoRepository = accountInfoRepository; _orderInfoRepository = orderInfoRepository; }
public CustomerService(EmployeeInfoRepository employeeInfoRepository , AccountInfoRepository accountInfoRepository , CustomerInfoRepository customerInfoRepository , OrderInfoRepository orderInfoRepository , RecordInfoRepository recordInfoRepository) { _employeeInfoRepository = employeeInfoRepository; _accountInfoRepository = accountInfoRepository; _customerInfoRepository = customerInfoRepository; _orderInfoRepository = orderInfoRepository; _recordInfoRepository = recordInfoRepository; }
public AccountService(EmployeeInfoRepository employeeInfoRepository , AccountInfoRepository accountInfoRepository) { _employeeInfoRepository = employeeInfoRepository; _accountInfoRepository = accountInfoRepository; }