public void TestSolarPanelThread()
        {
            ISHESToComponentsQueues queues         = new SHESToComponentsQueueMock();
            SolarPanelList          solarPanelList = new SolarPanelList(ref queues);

            Thread.Sleep(100);

            Assert.IsTrue(solarPanelList.SunPower == 100);
        }
Beispiel #2
0
        public SHES(ISHESToComponentsQueues queues)
        {
            CurrentPower = 0;
            Batteries    = new BatteryList(ref queues);
            Consumers    = new ConsumersList(ref queues);
            SolarPanels  = new SolarPanelList(ref queues);

            Utility     = new Utility(15);
            isConsuming = false;
            this.queues = queues;
        }
Beispiel #3
0
        public SHES()
        {
            CurrentPower = 0;
            Batteries    = new BatteryList();
            Consumers    = new ConsumersList();
            SolarPanels  = new SolarPanelList();
            ShesDbContext context = new ShesDbContext();

            Batteries.List.AddRange(context.Battery.ToList());
            Consumers.List.AddRange(context.Consumers.ToList());
            SolarPanels.List.AddRange(context.SolarPanels.ToList());
            Utility = new Utility(15);
        }
Beispiel #4
0
        public void TestSolarPanels50Sun()
        {
            SolarPanelList solarPanelList = new SolarPanelList();
            SolarPanel     sp1            = new SolarPanel(100, "sp1");
            SolarPanel     sp2            = new SolarPanel(100, "sp2");

            solarPanelList.List.Add(sp1);
            solarPanelList.List.Add(sp2);

            solarPanelList.SunPower = 0.5;
            var generating = solarPanelList.Generate();

            Assert.IsTrue(generating == 100);
        }