Inheritance: DriverMessageBase
 public void Visit(SetDriverLapTimeMessage message)
 {
     Result = true;
 }
 /// <inheritdoc/>
 public virtual void Visit(SetDriverLapTimeMessage message)
 {
 }
 void IMessageVisitor.Visit(SetDriverLapTimeMessage message)
 {
     Dispatch(message);
 }
 /// <inheritdoc/>
 public override void Visit(SetDriverLapTimeMessage message)
 {
     if(IsForMyDriver(message))
     {
         Model.LapTimes.Laps.Add(message.LapTime);
     }
 }
        public void when_a_driver_is_on_the_track_white_lap_time_column_colours_are_translated_into_set_lap_time_messages(SessionType session)
        {
            In(session).OnLap(5).Assert(translator =>
            {
                var driver = translator.GetDriver(1);
                var expected = new SetDriverLapTimeMessage(1, PT(95.571, PostedTimeType.Normal, 5));

                driver.LapNumber = 5;
                driver.ChangeStatus(DriverStatus.OnTrack);
                driver.SetColumnHasValue(GridColumn.LapTime, true);
                driver.LastLapTime = PT(95.571, PostedTimeType.Normal, 5);
                Assert.MessagesAreEqual(expected,
                    translator.Translate(new SetGridColumnColourMessage(1, GridColumn.LapTime, GridColumnColour.White))
                );
                Assert.Equal(expected.LapTime, driver.LastLapTime);
            });
        }
        public void when_a_driver_is_on_the_track_lap_time_column_values_are_translated_into_set_lap_time_messages(SessionType session)
        {
            In(session).OnLap(5).Assert(translator =>
            {
                SetDriverLapTimeMessage expected;
                LiveDriver driver = translator.GetDriver(1);

                driver.LapNumber = 5;
                driver.ChangeStatus(DriverStatus.OnTrack);
                // Normal lap time.
                expected = new SetDriverLapTimeMessage(1, PT(95.571, PostedTimeType.Normal, 5));
                Assert.MessagesAreEqual(expected,
                    translator.Translate(new SetGridColumnValueMessage(1, GridColumn.LapTime, GridColumnColour.White, "1:35.571"))
                );
                Assert.Equal(expected.LapTime, driver.LastLapTime);
                // Personal best lap time.
                expected = new SetDriverLapTimeMessage(1, PT(95.571, PostedTimeType.PersonalBest, 5));
                Assert.MessagesAreEqual(expected,
                    translator.Translate(new SetGridColumnValueMessage(1, GridColumn.LapTime, GridColumnColour.Green, "1:35.571"))
                );
                Assert.Equal(expected.LapTime, driver.LastLapTime);
                // Session best lap time.
                expected = new SetDriverLapTimeMessage(1, PT(95.571, PostedTimeType.SessionBest, 5));
                Assert.MessagesAreEqual(expected,
                    translator.Translate(new SetGridColumnValueMessage(1, GridColumn.LapTime, GridColumnColour.Magenta, "1:35.571"))
                );
                Assert.Equal(expected.LapTime, driver.LastLapTime);
            });
        }
 /// <inheritdoc/>
 public override void Visit(SetDriverLapTimeMessage message)
 {
     GetDriver(message).LastLapTime = message.LapTime;
 }