Commit c284d8e7 authored by Brickner_cp's avatar Brickner_cp

Improve SendAndReceievePacketTest.

parent eeeea13e
...@@ -81,13 +81,16 @@ namespace PcapDotNet.Core.Test ...@@ -81,13 +81,16 @@ namespace PcapDotNet.Core.Test
DateTime endSendingTime = DateTime.Now; DateTime endSendingTime = DateTime.Now;
for (int i = 0; i != NumPacketsToSend; ++i)
{
result = communicator.ReceivePacket(out packet); result = communicator.ReceivePacket(out packet);
Assert.AreEqual(PacketCommunicatorReceiveResult.Ok, result); Assert.AreEqual(PacketCommunicatorReceiveResult.Ok, result);
Assert.AreEqual<uint>(NumPacketsToSend, communicator.TotalStatistics.PacketsCaptured);
Assert.AreEqual(sentPacket.Length, packet.Length); Assert.AreEqual(sentPacket.Length, packet.Length);
MoreAssert.IsInRange(startSendingTime - TimeSpan.FromSeconds(1), endSendingTime + TimeSpan.FromSeconds(30), packet.Timestamp); MoreAssert.IsInRange(startSendingTime - TimeSpan.FromSeconds(1), endSendingTime + TimeSpan.FromSeconds(30), packet.Timestamp);
} }
Assert.AreEqual<uint>(NumPacketsToSend, communicator.TotalStatistics.PacketsCaptured);
}
} }
[TestMethod] [TestMethod]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment