private static void CallGetAvailableVehicles(string baseUrl) { Console.WriteLine("Calling CallGetAvailableVehicles web service " + baseUrl); var orderService = new WebOrder7Service { Url = baseUrl + "IWebOrder_7" }; try { var vehicles = orderService.GetAvailableVehicles("taxi", "test", 45.3417, -75.9233, 10000, 10000); if (vehicles.Count() == 0) { Console.WriteLine("Call made sucesfully but no vehicle found"); } foreach (var c in vehicles) { Console.WriteLine(string.Format("Vehicle found #{0} , Postion {1} / {2}", c.VehicleNumber, c.Latitude, c.Longitude)); } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void Setup() { Sut = new WebOrder7Service { Url = "http://apcurium.drivelinq.com:16928/IBSCab/IBSCab.dll/soap/IWebOrder7" }; _accountId = CreateIBSAccount(); }
public void when_creating_an_order() { var order = new TBookOrder_7(); order.ServiceProviderID = TheChauffeurGroupProviderId; order.AccountID = _accountId; var pickupDateTime = DateTime.Now.AddMinutes(5); order.PickupDate = new TWEBTimeStamp { Year = pickupDateTime.Year, Month = pickupDateTime.Month, Day = pickupDateTime.Day }; order.PickupTime = new TWEBTimeStamp { Hour = pickupDateTime.Hour, Minute = pickupDateTime.Minute, Second = 0, Fractions = 0 }; order.PickupAddress = new TWEBAddress { StreetPlace = "5252, rue ferrier, Montreal, H4P2H5", Latitude = 45.498068, Longitude = -73.656916 }; order.DropoffAddress = new TWEBAddress { StreetPlace = " ", Longitude = 0.00, Latitude = 0.00 }; order.Note = "This is a test"; order.Phone = "5145551234"; order.ContactPhone = "5145551234"; order.OrderDate = order.PickupDate; order.VehicleTypeID = 1; order.OrderStatus = TWEBOrderStatusValue.wosPost; var orderService = new WebOrder7Service { Url = "http://apcurium.drivelinq.com:16928/IBSCab/IBSCab.dll/soap/IWebOrder7" }; var orderId = orderService.SaveBookOrder_7("taxi", "test", order); Assert.Greater(orderId, 0); Trace.TraceInformation(orderId.ToString(CultureInfo.InvariantCulture)); }
private static void CallGetPriceEstimate(string baseUrl) { //var di = direction.GetDirectionDistance(51.434028, -0.526826, 51.5035709, -0.199753); Console.WriteLine("Calling CallGetPriceEstimate web service " + baseUrl); var orderService = new WebOrder7Service { Url = baseUrl + "IWebOrder_7" }; try { var oio = new TBookOrder_7 { OrderStatus = TWEBOrderStatusValue.wosPriceQry, PickupAddress = new TWEBAddress { Latitude = 45.3417, Longitude = -75.9233 }, DropoffAddress = new TWEBAddress { Latitude = 45.2897, Longitude = -75.8756 } }; double fare; double toll; double distance; orderService.EstimateFare("taxi", "test", oio, out fare, out toll, out distance); //var vehicles = orderService.GetAvailableVehicles("taxi", "test", 45.3417, -75.9233, 10000, 10000); //if (vehicles.Count() == 0) //{ // Console.WriteLine("Call made sucesfully but no vehicle found"); //} //foreach (var c in vehicles) //{ // Console.WriteLine(string.Format("Vehicle found #{0} , Postion {1} / {2}", c.VehicleNumber, c.Latitude, c.Longitude)); //} } catch (Exception ex) { Console.WriteLine(ex.Message); } }