Exemple #1
0
 public void ConstructorLosiParametri1(string n, double mp, double cap, double maxcap)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         eVehicleChargerModel vehicle = new eVehicleChargerModel(n, mp, cap, maxcap);
     });
 }
Exemple #2
0
        public void ConstructorParams(string n, double mp, double cap, double maxcap)
        {
            eVehicleChargerModel vehicle = new eVehicleChargerModel(n, mp, cap, maxcap);

            Assert.AreEqual(n, vehicle.Name);
            Assert.AreEqual(mp, vehicle.MaxPower);
            Assert.AreEqual(cap, vehicle.Capacity);
            Assert.AreEqual(maxcap, vehicle.MaxPower);
        }
Exemple #3
0
        public void ConstructorPrazan()
        {
            eVehicleChargerModel vehicle = new eVehicleChargerModel();

            Assert.AreEqual("", vehicle.Name);
            Assert.AreEqual(0, vehicle.MaxPower);
            Assert.AreEqual(0, vehicle.Capacity);
            Assert.AreEqual(0, vehicle.MaxCapacity);
            Assert.AreEqual(SmartHomeEnergySystem.Enums.VehicleEnumCharging.IDLE, vehicle.Charging);
            Assert.AreEqual(SmartHomeEnergySystem.Enums.VehicleEnumConnect.DISCONNECTED, vehicle.Connected);
        }
Exemple #4
0
 public void loadVehicles()
 {
     Vehicles = new ObservableCollection <eVehicleChargerModel>();
     using (dbSHESEntities entity = new dbSHESEntities())
     {
         List <eVehicleTable> lista = entity.eVehicleTables.ToList <eVehicleTable>();
         foreach (var item in lista)
         {
             eVehicleChargerModel vehicle = new eVehicleChargerModel(item.Name, (double)item.MaxPower, (double)item.Capacity, (double)item.MaxCapacity);
             Vehicles.Add(vehicle);
         }
     }
 }