示例#1
0
        public async Task ListFirstTorrentNameParsedCorrectly()
        {
            SetServerResponse("multiple-torrents");

            IEnumerable <HitAndRunTorrent> torrents = await endPoint.List().ConfigureAwait(false);

            HitAndRunTorrent firstTorrent = torrents.First();

            Assert.That("A.karate.kolyok.2010.1080p.RETAiL.BluRay.x264.HUN-BiTZo...", Is.EqualTo(firstTorrent.UploadName));
        }
示例#2
0
        public async Task ListFirstTorrentIDParsedCorrectly()
        {
            SetServerResponse("multiple-torrents");

            IEnumerable <HitAndRunTorrent> torrents = await endPoint.List().ConfigureAwait(false);

            HitAndRunTorrent firstTorrent = torrents.First();

            Assert.That(830948, Is.EqualTo(firstTorrent.ID));
        }
示例#3
0
        public async Task ListFirstTorrentRatioParsedCorrectly()
        {
            SetServerResponse("multiple-torrents");
            DateTime currentTime = DateTime.Now;

            IEnumerable <HitAndRunTorrent> torrents = await endPoint.List().ConfigureAwait(false);

            HitAndRunTorrent firstTorrent = torrents.First();

            Assert.That(firstTorrent.Ratio, Is.EqualTo(0.013f));
        }
示例#4
0
        public async Task ListFirstTorrentHitAndRunParsedCorrectly()
        {
            SetServerResponse("multiple-torrents");
            DateTime currentTime = DateTime.Now;

            IEnumerable <HitAndRunTorrent> torrents = await endPoint.List().ConfigureAwait(false);

            HitAndRunTorrent firstTorrent = torrents.First();

            Assert.That(currentTime.Subtract(firstTorrent.HitAndRunEnd).TotalSeconds, Is.LessThan(2));
        }
示例#5
0
 /// <inheritdoc />
 public Task <Torrent> Get(HitAndRunTorrent torrent)
 {
     return(Get(torrent.ID));
 }