コード例 #1
0
 //[ExpectedException (typeof (InvalidOperationException))]
 public void AddPeers_PrivateTorrent()
 {
     Assert.Catch <InvalidOperationException>(() => {
         // 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")));
     });
 }