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)); }
public void TestNullPassedForManagerToPieceBuffer() { Assert.Throws <ArgumentNullException>(() => { PieceBuffer piece = new PieceBuffer(null, BitTorrentLibrary.Constants.BlockSize); }); }