public void Returning_to_pits_does_not_set_previous_lap_as_fastest()
        {
            // set outlap
            var manager = new TelemetryLapManager();
            foreach (var packet in TelemetryLapHelper.CreateOutLap().Packets) manager.ProcessIncomingPacket(packet);

            // Add nearly all of a lap
            var firstLap = TelemetryLapHelper.CreatePopulatedLap(lapNumber: 1f, completeLap: true);
            for (var i = 0; i < firstLap.Packets.Count - 2; i++) manager.ProcessIncomingPacket(firstLap.Packets[i]);

            Assert.IsNull(manager.FastestLap);

            var garagePacket = new TelemetryPacket {Lap = 0f, Speed = 0f, LapDistance = -0.001f};
            Assert.IsTrue(garagePacket.IsSittingInPits);
            manager.ProcessIncomingPacket(garagePacket);

            Assert.IsNull(manager.FastestLap);
        }
        public void Start_of_first_full_lap_does_not_set_fastest_lap()
        {
            var manager = new TelemetryLapManager();

            foreach (var packet in TelemetryLapHelper.CreateOutLap().Packets) manager.ProcessIncomingPacket(packet);

            var fullLap = TelemetryLapHelper.CreatePopulatedLap(lapNumber: 1f);
            Assert.IsTrue(fullLap.IsFirstPacketStartLine);  // Lap we just added must be a full lap

            manager.ProcessIncomingPacket(fullLap.Packets[0]);

            Assert.IsNull(manager.FastestLap);
        }
 public void SetUp()
 {
     _manager = new TelemetryLapManager();
     foreach (var packet in TelemetryLapHelper.CreateOutLap().Packets) _manager.ProcessIncomingPacket(packet);
     foreach (var packet in TelemetryLapHelper.CreatePopulatedLap(lapNumber: 1f).Packets) _manager.ProcessIncomingPacket(packet);
 }