public async Task CreateVenue(VenueDto venueDto, string adminKey) { if (await m_AdministratorService.IsProvidedAdministratorKeyValid(adminKey)) { await m_VenueRepository.Persist(Mapper.Map<Venue>(venueDto)).ConfigureAwait(false); } }
public void CreateVenueShouldCallRepository() { VenueDto venue = new VenueDto(); m_VenueRepositoryMock = new Mock<IVenueRepository>(); m_VenueService = new VenueService(m_VenueRepositoryMock.Object); m_VenueService.CreateVenue(venue); m_VenueRepositoryMock.Verify(x => x.Persist(It.IsAny<Venue>()), Times.Once); }
public async Task<HttpResponseMessage> Create(VenueDto venueDto, string adminKey) { await m_VenueService.CreateVenue(venueDto, adminKey).ConfigureAwait(false); return Request.CreateResponse(HttpStatusCode.Created); }