Example #1
0
        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;
        }
Example #2
0
        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>());
            }
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }
Example #5
0
        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();
        }
Example #6
0
 public IOrder EnterandBuy(ICustomer costumer, IProducer producer, IVehicule vehicule)
 {
     Console.WriteLine($"{customer.Name} enter to {this.Name}");
     Console.WriteLine(($"{customer.Name} orders  { vehicule.Name}");
 }
Example #7
0
 public AFacade(IMoto moto, IVehicule vehicule)
 {
     Moto     = moto;
     Vehicule = vehicule;
 }
Example #8
0
 public void InitVehicule() => Vehicule = new Car();
Example #9
0
 public void Setup()
 {
     motorHome = new MotorHome();
 }
Example #10
0
        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());
        }
Example #11
0
 public void InitVehicule() => Vehicule = new Bike();
Example #12
0
 public Facade(IMoto moto, IVehicule vehicule) : base(moto, vehicule)
 {
 }
Example #13
0
 // IVehicule V1 = new Moto();
 // VehiculeAdapte VA1 = new VehiculeAdapte(V1);
 // VA1.DemarrageAdapte();
 public VehiculeAdapte(IVehicule autreVehicule)
 {
     this._vehicule = autreVehicule;
 }
Example #14
0
 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);
 }
Example #16
0
 public void Setup()
 {
     car = new Car();
 }