public VehiculeViewModel(IVehicule pVehicule) { if (pVehicule == null) { throw new ArgumentNullException("pVehicule"); } ID = pVehicule.ID; Name = pVehicule.Name; PlateNumber = pVehicule.PlateNumber; Make = pVehicule.Make; Model = pVehicule.Model; Data = pVehicule; }
public IEnumerable <IPosition> GetPositions(IAuthentificationToken pToken, IVehicule pVehicule) { if (CheckIsDisposed()) { return(null); } try { return(_eventService.GetPositionsForToday(pToken, pVehicule)); } catch (Exception exception) { SendError(exception.Message); return(Enumerable.Empty <IPosition>()); } }
public void TestBikeBuilder() { IBuilder builder = new BikeBuilder(); builder.InitVehicule(); builder.AddBody(); builder.AddEngine(); for (int i = 0; i < Bike.MAX_WHEELS; ++i) { builder.AddWheel(); } IVehicule bike = builder.GetVehicule(); string bikeDescription = bike.GetVehiculeDescription(); StringBuilder strBuilder = new StringBuilder(); strBuilder.Append("Bike vehicule").AppendLine() .Append("Wheels: 2 bike wheel.s").AppendLine() .Append("Engine: Bike engine").AppendLine() .Append("Body: Bike body").AppendLine(); Assert.AreEqual(strBuilder.ToString(), bikeDescription); }
public void TestCarBuilder() { IBuilder builder = new CarBuilder(); builder.InitVehicule(); builder.AddBody(); builder.AddEngine(); for (int i = 0; i < Car.MAX_WHEELS; ++i) { builder.AddWheel(); } IVehicule car = builder.GetVehicule(); string carDescription = car.GetVehiculeDescription(); StringBuilder strBuilder = new StringBuilder(); strBuilder.Append("Car vehicule").AppendLine() .Append("Wheels: 4 car wheel.s").AppendLine() .Append("Engine: Car engine").AppendLine() .Append("Body: Car body").AppendLine(); Assert.AreEqual(strBuilder.ToString(), carDescription); }
private void Button_Click(object sender, RoutedEventArgs e) { string type_Vehicule = cmb_Vehicule.Text; switch (type_Vehicule) { case "Avion": monVehicule = new Avion(); break; case "Voiture": monVehicule = new Voiture(); break; case "Moto": monVehicule = new Moto(); break; default: break; } monVehicule.Rouler(); }
public IOrder EnterandBuy(ICustomer costumer, IProducer producer, IVehicule vehicule) { Console.WriteLine($"{customer.Name} enter to {this.Name}"); Console.WriteLine(($"{customer.Name} orders { vehicule.Name}"); }
public AFacade(IMoto moto, IVehicule vehicule) { Moto = moto; Vehicule = vehicule; }
public void InitVehicule() => Vehicule = new Car();
public void Setup() { motorHome = new MotorHome(); }
public IEnumerable <IPosition> GetPositionsForToday(IAuthentificationToken pToken, IVehicule pVehicule) { if (pToken == null) { throw new ArgumentNullException("pToken"); } var token = new Token() { Value = pToken.Value }; var now = DateTime.Now; var startDate = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0, DateTimeKind.Utc); var endDate = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59, DateTimeKind.Utc); var eventRequest = new EventRequest() { UnsafeToken = token, Vehicles = new[] { pVehicule.ID }, StartDateTime = startDate, EndDateTime = endDate }; var response = _client.GetPositionEvent(eventRequest); if (response == null) { return(Enumerable.Empty <IPosition>()); } return(response.ConvertToPositions().ToList()); }
public void InitVehicule() => Vehicule = new Bike();
public Facade(IMoto moto, IVehicule vehicule) : base(moto, vehicule) { }
// IVehicule V1 = new Moto(); // VehiculeAdapte VA1 = new VehiculeAdapte(V1); // VA1.DemarrageAdapte(); public VehiculeAdapte(IVehicule autreVehicule) { this._vehicule = autreVehicule; }
public Order(ICustomer customer, IVehicule vehicule, DateTime data) { this.Customer = customer; this.Vehicule = vehicule; this.DeliveryTime = data; }
public IAvailableVehicules RentVehicule <T>() where T : IVehicule { RentalVehicule = AvailableRentalVehicules.Value.OfType <T>().FirstOrDefault(); return(this); }
public void Setup() { car = new Car(); }