public async Task <TorrentView> Post(TorrentCreateView model) { var torrent = _mapper.Map <Torrent>(model); var result = await _torrentService.AddAsync(torrent); return(_mapper.Map <TorrentView>(result)); }
public async Task AddAsync_Null_ThrowRutrackerException() { // Act & Assert var exception = await Assert.ThrowsAsync <RutrackerException>(async() => await _torrentService.AddAsync(null)); Assert.Equal(ExceptionEventTypes.InvalidParameters, exception.ExceptionEventType); }