Example #1
0
 public PlayerServiceRegisterTransactionTests()
 {
     _cancellationToken    = CancellationToken.None;
     _playersWalletContext = DataContextHelper.GetInMemoryDataContext();
     _unitOfWorkMock       = DataContextHelper.GetUnitOfWorkMock(_playersWalletContext);
     _underTest            = new PlayerService(_unitOfWorkMock, NullLogger <PlayerService> .Instance);
 }
Example #2
0
 public UnitOfWorkMock(IPlayersWalletContext context)
 {
     Context                  = context;
     Players                  = new PlayerRepository(Context);
     Wallets                  = new WalletRepository(Context);
     Transactions             = new TransactionRepository(Context);
     TransactionResponseCache = new TransactionResponseCacheRepository(Context);
 }
Example #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);
        }
Example #4
0
 public TransactionResponseCacheRepository(IPlayersWalletContext context) : base(context)
 {
 }
Example #5
0
 public PlayerRepository(IPlayersWalletContext context) : base(context)
 {
 }
 public static IUnitOfWork GetUnitOfWorkMock(IPlayersWalletContext context)
 {
     return(new UnitOfWorkMock(context));
 }
Example #7
0
 public Repository(IPlayersWalletContext context)
 {
     Context = context;
 }