public void TimeToNextFrame_CalledWhenBarrierIsReached_ReturnsPositiveTime() { var barrier = new PacketBarrier(TimeFrame); var firstPacket = CreateDataPacket(TimeSpan.FromSeconds(2)); var secondPacket = CreateDataPacket(TimeSpan.FromSeconds(3)); barrier.PacketPushed(firstPacket); barrier.PacketPushed(secondPacket); Assert.That(barrier.TimeToNextFrame(), Is.GreaterThan(TimeSpan.Zero)); }
public void TimeToNextFrame_CalledBeforeFirstPacket_ThrowsInvalidOperationException() { var barrier = new PacketBarrier(TimeFrame); Assert.Throws <InvalidOperationException>(() => barrier.TimeToNextFrame()); }