Esempio n. 1
0
 /// <inheritdoc/>
 public virtual void Visit(ReplaceDriverLapTimeMessage message)
 {
 }
Esempio n. 2
0
 public void Visit(ReplaceDriverLapTimeMessage message)
 {
     Result = true;
 }
 void IMessageVisitor.Visit(ReplaceDriverLapTimeMessage message)
 {
     Dispatch(message);
 }
Esempio n. 4
0
 /// <inheritdoc/>
 public override void Visit(ReplaceDriverLapTimeMessage message)
 {
     if(IsForMyDriver(message))
     {
         Model.LapTimes.Laps.ReplaceCurrent(message.Replacement);
     }
 }
        public void when_a_driver_is_on_the_track_green_and_megenta_lap_time_column_colours_are_translated_into_replace_lap_time_messages(SessionType session)
        {
            In(session).OnLap(5).Assert(translator =>
            {
                ReplaceDriverLapTimeMessage expected;
                LiveDriver driver = translator.GetDriver(1);

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