예제 #1
0
        public async Task <TorrentView> Post(TorrentCreateView model)
        {
            var torrent = _mapper.Map <Torrent>(model);

            var result = await _torrentService.AddAsync(torrent);

            return(_mapper.Map <TorrentView>(result));
        }
예제 #2
0
        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);
        }