Пример #1
0
 public PlayerServiceRegisterTransactionTests()
 {
     _cancellationToken    = CancellationToken.None;
     _playersWalletContext = DataContextHelper.GetInMemoryDataContext();
     _unitOfWorkMock       = DataContextHelper.GetUnitOfWorkMock(_playersWalletContext);
     _underTest            = new PlayerService(_unitOfWorkMock, NullLogger <PlayerService> .Instance);
 }
Пример #2
0
 public UnitOfWorkMock(IPlayersWalletContext context)
 {
     Context                  = context;
     Players                  = new PlayerRepository(Context);
     Wallets                  = new WalletRepository(Context);
     Transactions             = new TransactionRepository(Context);
     TransactionResponseCache = new TransactionResponseCacheRepository(Context);
 }
Пример #3
0
        public async Task <Transaction> CreateAsync(IPlayersWalletContext dbContext, CancellationToken cancellationToken)
        {
            var entity = Build();

            await dbContext.Transactions.AddAsync(entity, cancellationToken).ConfigureAwait(false);

            await dbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false);

            return(entity);
        }
Пример #4
0
 public TransactionResponseCacheRepository(IPlayersWalletContext context) : base(context)
 {
 }
Пример #5
0
 public PlayerRepository(IPlayersWalletContext context) : base(context)
 {
 }
Пример #6
0
 public static IUnitOfWork GetUnitOfWorkMock(IPlayersWalletContext context)
 {
     return(new UnitOfWorkMock(context));
 }
Пример #7
0
 public Repository(IPlayersWalletContext context)
 {
     Context = context;
 }