public void OnTimer_ForStart_WithoutWaitingRider_ShouldIgnoreEvent() { //0 is the start gate timer.EmitTriggerEvent(100, "Timer", 0, new DateTime(2000, 1, 1, 1, 1, 1)); source.Cancel(); RaceSummary summary = race.Result; var state = subject.GetState; Assert.AreEqual(0, summary.Events.Count); Assert.AreEqual(0, state.onTrack.Count); Assert.AreEqual(0, state.waiting.Count); }
/// <summary> /// Makes events for a lap finish at start + 1 minute /// </summary> /// <param name="riderName"></param> /// <param name="sensorId"></param> /// <param name="end"></param> /// <param name="id"></param> /// <param name="time"></param> private void MakeEndEvents(Rider rider, DateTime end, MockRiderIdUnit id, MockTimingUnit time) { id.EmitIdEvent(rider, end); time.EmitTriggerEvent(100, "Timer", 1, end); id.EmitExitEvent(rider, end); }
/// <summary> /// Makes events for a lap finish at start + 1 minute /// </summary> /// <param name="riderName"></param> /// <param name="sensorId"></param> /// <param name="end"></param> /// <param name="id"></param> /// <param name="time"></param> private void MakeEndEvents(Rider rider, DateTime end, long microseconds, MockRiderIdUnit id, MockTimingUnit time) { id.EmitIdEvent(rider, end); time.EmitTriggerEvent(microseconds, "Timer", 1, end); }
/// <summary> /// Makes events for a lap begin at start /// </summary> /// <param name="riderName"></param> /// <param name="sensorId"></param> /// <param name="start"></param> /// <param name="id"></param> /// <param name="time"></param> private void MakeStartEvents(Rider rider, DateTime start, MockRiderIdUnit id, MockTimingUnit time) { id.EmitIdEvent(rider, start); time.EmitTriggerEvent(100, "Timer", 0, start); id.EmitExitEvent(rider, start); }
/// <summary> /// Makes events for a lap begin at start /// </summary> /// <param name="riderName"></param> /// <param name="sensorId"></param> /// <param name="start"></param> /// <param name="id"></param> /// <param name="time"></param> private void MakeStartEvents(Rider rider, DateTime start, long microseconds, MockRiderIdUnit id, MockTimingUnit time) { id.EmitIdEvent(rider, start); time.EmitTriggerEvent(microseconds, "Timer", 0, start); }