public UnitOfWork(WALLETContext context) { _context = context; Users = new UserRepository(_context); Transactions = new TransactionRepository(_context); FixedTermDeposits = new FixedTermDepositRepository(_context); Accounts = new AccountRepository(_context); TransactionLog = new TransactionLogRepository(_context); Rates = new RatesRepository(_context); RefundRequest = new RefundRequestRepository(_context); Transfers = new TransfersRepository(_context); EmailTemplates = new EmailTemplatesRepository(_context); }
public TestBase(int userId = 1) { // Set appsettings configuration _configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.test.json") .Build(); // Set Mock identity _identity = new ClaimsIdentity(); _user = new ClaimsPrincipal(_identity); _controllerContext = new ControllerContext { HttpContext = new DefaultHttpContext { User = _user } }; _identity.AddClaims(new[] { new Claim("UserId", userId.ToString()), }); // Set Database in memory context = new WALLETContext(GetDbOptionsBuilder().Options); DataInitializer.Initialize(context); // Set Unit of Work _unitOfWork = new UnitOfWork(context); // Set account businness _accountBusiness = new AccountBusiness(_unitOfWork); // Set rates _ratesBusiness = new RatesBusiness(_unitOfWork, _mapper); // Set Mapper var mappingConfig = new MapperConfiguration(mc => { mc.AddProfile(new AutoMapperProfile()); }); _mapper = mappingConfig.CreateMapper(); }
public AccountRepository(WALLETContext context) : base(context) { }
public UserRepository(WALLETContext context) : base(context) { }
public EmailTemplatesRepository(WALLETContext context) : base(context) { }
public RefundRequestRepository(WALLETContext context) : base(context) { }
public FixedTermDepositRepository(WALLETContext context) : base(context) { }
public TransactionRepository(WALLETContext context) : base(context) { }
public TransfersRepository(WALLETContext context) : base(context) { }
public GenericRepository(WALLETContext context) { _context = context; }
public RatesRepository(WALLETContext context) : base(context) { }