public void SingleFileDoNotDownload() { _picker.Initialise(_rig.Manager.Bitfield, new TorrentFile[] { _rig.Torrent.Files[0] }, new List <Piece>()); _rig.Torrent.Files[0].Priority = Priority.DoNotDownload; _picker.PickPiece(_id, _id.BitField, new List <PeerId>(), 1, 0, _rig.Pieces); Assert.AreEqual(0, _tester.PickPieceBitfield.Count, "#1"); }
public void Setup() { id.BitField.SetAll(true); tester = new TestPicker(); picker = new PriorityPicker(tester); picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List<Piece>()); foreach (TorrentFile file in rig.Torrent.Files) file.Priority = Priority.Normal; }
public void Setup() { _id.BitField.SetAll(true); _tester = new TestPicker(); _picker = new PriorityPicker(_tester); _picker.Initialise(_rig.Manager.Bitfield, _rig.Torrent.Files, new List <Piece>()); foreach (TorrentFile file in _rig.Torrent.Files) { file.Priority = Priority.Normal; } }
public PriorityPickerTests() { rig = TestRig.CreateMultiFile(); id = new PeerId(new Peer(new string('a', 20), new Uri("tcp://BLAH")), rig.Manager); id.BitField.SetAll(true); id.BitField.SetAll(true); tester = new TestPicker(); picker = new PriorityPicker(tester); picker.Initialise(rig.Manager.Bitfield, rig.Torrent.Files, new List<Piece>()); foreach (var file in rig.Torrent.Files) file.Priority = Priority.Normal; }