public void AddPeers_PrivateTorrent ()
 {
     // You can't manually add peers to private torrents
     var dict = (BEncodedDictionary) rig.TorrentDict["info"];
     dict ["private"] = (BEncodedString) "1";
     Torrent t = Torrent.Load (rig.TorrentDict);
     TorrentManager manager = new TorrentManager (t, "path", new TorrentSettings ());
     manager.AddPeers (new Peer ("id", new Uri ("tcp:://whatever.com")));
 }
 public void AddPeers_PrivateTorrent()
 {
     // You can't manually add peers to private torrents
     var dict = (BEncodedDictionary) rig.TorrentDict["info"];
     dict["private"] = (BEncodedString) "1";
     var t = Torrent.Load(rig.TorrentDict);
     var manager = new TorrentManager(t, "path", new TorrentSettings());
     Assert.Throws<InvalidOperationException>(
         () => manager.AddPeers(new Peer("id", new Uri("tcp:://whatever.com"))));
 }
示例#3
0
        public void AddPeers_PrivateTorrent()
        {
            // You can't manually add peers to private torrents
            var dict = (BEncodedDictionary)rig.TorrentDict["info"];

            dict ["private"] = (BEncodedString)"1";
            Torrent        t       = Torrent.Load(rig.TorrentDict);
            TorrentManager manager = new TorrentManager(t, "path", new TorrentSettings());

            manager.AddPeers(new Peer("id", new Uri("tcp:://whatever.com")));
        }