Пример #1
0
 public void Setup()
 {
     checker = new PiecePickerFilterChecker(new StandardPicker());
     picker  = new RandomisedPicker(checker);
     seeder  = PeerId.CreateNull(40, true, false, true);
     picker.Initialise(new TestTorrentData());
 }
Пример #2
0
 public void Setup()
 {
     checker = new PiecePickerFilterChecker(new StandardPicker());
     picker  = new RandomisedPicker(checker);
     seeder  = PeerId.CreateNull(40, true, false, true);
     picker.Initialise(TestTorrentManagerInfo.Create(pieceLength: Constants.BlockSize * 2, size: Constants.BlockSize * 2 * 40));
 }
Пример #3
0
        public void SinglePieceBitfield()
        {
            picker.Initialise(new OnePieceTorrentData());
            picker.PickPiece(seeder, new MutableBitField(1).SetAll(true), new List <PeerId> ());

            Assert.AreEqual(1, checker.Picks.Count, "#1");
            Assert.AreEqual(0, checker.Picks[0].startIndex, "#2");
            Assert.AreEqual(0, checker.Picks[0].endIndex, "#2");
        }