public void ConstructorLosiParametri1(string n, double mp, double cap, double maxcap) { Assert.Throws <ArgumentException>(() => { eVehicleChargerModel vehicle = new eVehicleChargerModel(n, mp, cap, maxcap); }); }
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); }
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); }
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); } } }