Exemplo n.º 1
0
        private void AddCar()
        {
            // If AddCarButton is clicked when entry is empty, nothing happens
            if (NewCar != null && NewCar.Length == 0)
            {
                return;
            }
            var nCar = new CarModel(NewCar);

            DataService.AddCar(nCar);
            Cars.Add(new SelectableItemWrapper <CarModel>(nCar));
            NewCar = "";             // Clear entry after saving
        }
Exemplo n.º 2
0
 public void AddCarTest()
 {
     Assert.AreEqual(0, dataService.GetAllCars().Count());
     dataService.AddCar("Skoda", "Fabia", "Style", 210, "Silver Metalic", VehicleType.Small_car, FuelType.Petrol, Transmission.Manual);
     Assert.AreEqual(1, dataService.GetAllCars().Count());
 }