public void ResendsPacket() { TransferStub transferWithLowTimeout = new TransferStub(new MemoryStream(new byte[5000])); transferWithLowTimeout.RetryTimeout = new TimeSpan(0); transferWithLowTimeout.SetState(new Sending()); Assert.IsTrue(transferWithLowTimeout.CommandWasSent(typeof(Data))); transferWithLowTimeout.SentCommands.Clear(); transferWithLowTimeout.OnTimer(); Assert.IsTrue(transferWithLowTimeout.CommandWasSent(typeof(Data))); }
public void CanCancel() { transfer.Cancel(TftpErrorPacket.IllegalOperation); Assert.IsTrue(transfer.CommandWasSent(typeof(Error))); Assert.IsInstanceOf <Closed>(transfer.State); }
public void SendsPacket() { Assert.IsTrue(transfer.CommandWasSent(typeof(Data))); }
public void ReceivesPacket() { transfer.OnCommand(new Data(1, new byte[100])); Assert.IsTrue(transfer.CommandWasSent(typeof(Acknowledgement))); Assert.AreEqual(100, ms.Length); }