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