Esempio n. 1
0
 public void ConstructorLosiParametri1(string n, double mp)
 {
     Assert.Throws <ArgumentException>(() =>
     {
         SolarPanelModel panel = new SolarPanelModel(n, mp);
     });
 }
Esempio n. 2
0
        public void ConstructorPrazan()
        {
            SolarPanelModel panel = new SolarPanelModel();

            Assert.AreEqual("", panel.Name);
            Assert.AreEqual(0, panel.MaxPower);
            Assert.AreEqual(0, panel.CurrentPower);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
                    }
                }
            };
        }
Esempio n. 5
0
 public DeleteSolarPanelCommand(SolarPanelModel panelToDelete)
 {
     this.panelToDelete = panelToDelete;
 }