public async Task<Bet> MapFromDto(BetDto betDto) { return new Bet { BoxerId = betDto.BoxerId, MatchId = betDto.MatchId, Id = betDto.Id, UserId = betDto.UserId, Canceled = betDto.Canceled }; }
public async Task PlaceBetShouldCallRepository() { BetDto bet = new BetDto(); m_BetRepositoryMock = new Mock<IBetRepository>(); m_BetMapperMock = new Mock<IBetMapper>(); m_BetService = new BetService(m_BetRepositoryMock.Object, m_BetMapperMock.Object); await m_BetService.CreateBet(bet).ConfigureAwait(false); m_BetRepositoryMock.Verify(x => x.Persist(It.IsAny<Bet>()), Times.Once); }
public async Task<HttpResponseMessage> Create(BetDto bet) { await m_BetService.CreateBet(bet).ConfigureAwait(false); return Request.CreateResponse(HttpStatusCode.Created); }
public async Task CreateBet(BetDto bet) { await m_BetRepository.Persist(await m_BetMapper.MapFromDto(bet).ConfigureAwait(false)).ConfigureAwait(false); }