public void ConstructorLosiParametri1(string n, double mp) { Assert.Throws <ArgumentException>(() => { SolarPanelModel panel = new SolarPanelModel(n, mp); }); }
public void ConstructorPrazan() { SolarPanelModel panel = new SolarPanelModel(); Assert.AreEqual("", panel.Name); Assert.AreEqual(0, panel.MaxPower); Assert.AreEqual(0, panel.CurrentPower); }
public void ConstructorParams(string n, double mp) { SolarPanelModel panel = new SolarPanelModel(n, mp); Assert.AreEqual(n, panel.Name); Assert.AreEqual(mp, panel.MaxPower); Assert.AreEqual(0, panel.CurrentPower); }
public void loadSolarPanels() { solarPanels = new ObservableCollection <SolarPanelModel>(); using (dbSHESEntities entity = new dbSHESEntities()) { List <SolarPanelTable> cons = entity.SolarPanelTables.ToList <SolarPanelTable>(); if (cons != null) { foreach (var c in cons) { SolarPanelModel consumer = new SolarPanelModel(c.Name, (double)c.MaxPower, (double)c.CurrentPower); solarPanels.Add(consumer); } } }; }
public DeleteSolarPanelCommand(SolarPanelModel panelToDelete) { this.panelToDelete = panelToDelete; }