コード例 #1
0
        public void TestPassNullForBufferToAddBlockFromPacket()
        {
            MetaInfoFile file = new MetaInfoFile(Constants.SingleFileTorrent);

            file.Parse();
            TorrentContext tc          = new TorrentContext(file, new Selector(), new DiskIO(new Manager()), Constants.DestinationDirectory);
            PieceBuffer    pieceBuffer = new PieceBuffer(tc, BitTorrentLibrary.Constants.BlockSize);

            Assert.Throws <ArgumentNullException> (() => pieceBuffer.AddBlockFromPacket(null, BitTorrentLibrary.Constants.BlockSize));
        }
コード例 #2
0
 public void TestNullPassedForManagerToPieceBuffer()
 {
     Assert.Throws <ArgumentNullException>(() => { PieceBuffer piece = new PieceBuffer(null, BitTorrentLibrary.Constants.BlockSize); });
 }