public void CorruptList()
        {
            var list = new BEncodedList();
            for (var i = 0; i < peers.Count; i++)
                list.Add((BEncodedString) peers[i].CompactPeer());

            list.Insert(2, new BEncodedNumber(5));
            VerifyDecodedPeers(Peer.Decode(list));

            list.Clear();
            list.Add(new BEncodedString(new byte[3]));
            IList<Peer> decoded = Peer.Decode(list);
            Assert.Equal(0, decoded.Count);
        }
        public void CorruptList()
        {
            BEncodedList list = new BEncodedList();

            for (int i = 0; i < peers.Count; i++)
            {
                list.Add((BEncodedString)peers[i].CompactPeer());
            }

            list.Insert(2, new BEncodedNumber(5));
            VerifyDecodedPeers(Peer.Decode(list));

            list.Clear();
            list.Add(new BEncodedString(new byte[3]));
            IList <Peer> decoded = Peer.Decode(list);

            Assert.AreEqual(0, decoded.Count, "#1");
        }
 public void Insert(int index, RawTrackerTier item)
 {
     Tiers.Insert(index, item.Tier);
 }
Exemple #4
0
 public void Insert(int index, string item)
 {
     Tier.Insert(index, (BEncodedString)item);
 }