예제 #1
0
        public void TestGetFiles()
        {
            try
            {
                UTorrentClient client   = new UTorrentClient("admin", "password");
                var            response = client.GetList();
                Assert.IsNull(response.Error);
                Assert.IsNotNull(response.Result);
                Assert.IsNotNull(response.Result.Torrents);
                Assert.AreNotEqual(response.Result.Torrents.Count, 0);

                var torrent = response.Result.Torrents[0];
                response = client.GetFiles(torrent.Hash.ToLower());
                Assert.IsNull(response.Error);
                Assert.IsNotNull(response.Result);
                Assert.IsNotNull(response.Result.Files);
                Assert.AreNotEqual(response.Result.Files.Count, 0);
            }
            catch (ServerUnavailableException)
            {
                Assert.Inconclusive("Serveur unavailable");
            }
            catch (InvalidCredentialException)
            {
                Assert.Inconclusive("Invalid credential");
            }
        }
 public void TestGetFilesWithNullHash()
 {
     UTorrentClient client = new UTorrentClient("admin", "password");
     client.GetFiles(null);
 }
        public void TestGetFiles()
        {
            try
            {
                UTorrentClient client = new UTorrentClient("admin", "password");
                var response = client.GetList();
                Assert.IsNull(response.Error);
                Assert.IsNotNull(response.Result);
                Assert.IsNotNull(response.Result.Torrents);
                Assert.AreNotEqual(response.Result.Torrents.Count, 0);

                var torrent = response.Result.Torrents[0];
                response = client.GetFiles(torrent.Hash.ToLower());
                Assert.IsNull(response.Error);
                Assert.IsNotNull(response.Result);
                Assert.IsNotNull(response.Result.Files);
                Assert.AreNotEqual(response.Result.Files.Count, 0);
            }
            catch (ServerUnavailableException)
            {
                Assert.Inconclusive("Serveur unavailable");
            }
            catch (InvalidCredentialException)
            {
                Assert.Inconclusive("Invalid credential");
            }
        }
예제 #4
0
        public void TestGetFilesWithNullHash()
        {
            UTorrentClient client = new UTorrentClient("admin", "password");

            client.GetFiles(null);
        }
예제 #5
0
        public void TestGetFilesWithNullHash()
        {
            UTorrentClient client = new UTorrentClient("admin", "password");

            Assert.ThrowsException <ArgumentNullException>(() => client.GetFiles(null));
        }