static int Main(string[] args) { int status = 0; string tflAppId = ConfigurationManager.AppSettings["TflAppId"]; string tflAppKey = ConfigurationManager.AppSettings["TflAppKey"]; TfLApiClient.GetInstance().SetApiKeys(tflAppId, tflAppKey); if (args != null && args.Length > 0) { string roadId = args[0]; string msg = string.Empty; RoadInformation info = RoadStatus.GetStatus(roadId); if (info.Valid) { msg = string.Format(ValidaRoadMessage, info.Name, info.StatusSeverity, info.StatusSeverityDescription); } else { msg = string.Format(InvalidRoadMessage, roadId); status = 1; } Console.WriteLine(msg); } return(status); }
DataService() { roadInformation = new RoadInformation(); boothInformation = new BoothInformation(); agentInformation = new AgentInformation(); contactsInformation = new ContactsInformation(); }
public void Check_InvalidRoadStatus_ErrorCode_Test() { RoadInformation status = RoadStatus.GetStatus("A1000"); Assert.IsNotNull(RoadStatus.LastErrorCode); }
public void Check_ValidRoadStatus_StatusDescription_Test() { RoadInformation status = RoadStatus.GetStatus("A1"); Assert.IsNotNull(status.StatusSeverityDescription); }
public void Check_ValidRoadStatus_DisplayName_Test() { RoadInformation status = RoadStatus.GetStatus("A1"); Assert.IsNotNull(status.Name); }
public void Check_InvalidRoadStatus_Test() { RoadInformation status = RoadStatus.GetStatus("A1000"); Assert.IsFalse(status.Valid); }
public void Check_ValidRoadStatus_Test() { RoadInformation status = RoadStatus.GetStatus("A1"); Assert.IsTrue(status.Valid); }
public void Register_APIKeys_NotAvailableException_Test() { TfLApiClient.GetInstance().SetApiKeys(string.Empty, string.Empty); RoadInformation status = RoadStatus.GetStatus("A1"); }
private void ProcessAnser( RoadInformation end, float distance ) { if ( !end.CanDriver ) { this._freeWay = false; this._canDriver = false; this.SetDestinationPositionAndSpeed( distance - this._car.Lenght / 2, 0.0f ); } if ( end.CarAhead != null ) { this.ProcessCarAheadInformation( end.CarAhead, end.CarAheadDistance, distance ); } if ( end.PrivilagesCarInformation != null ) { this.ProcesPrivilagesCarInformation( end.PrivilagesCarInformation, distance ); } }