コード例 #1
0
        public void TestBatteryThreadConsuming()
        {
            ISHESToComponentsQueues queues      = new SHESToComponentsQueueMock();
            BatteryList             batteryList = new BatteryList(ref queues);

            Thread.Sleep(100);
            Assert.IsTrue(batteryList.IsConsumig);
        }
コード例 #2
0
        public void TestSolarPanelThread()
        {
            ISHESToComponentsQueues queues         = new SHESToComponentsQueueMock();
            SolarPanelList          solarPanelList = new SolarPanelList(ref queues);

            Thread.Sleep(100);

            Assert.IsTrue(solarPanelList.SunPower == 100);
        }
コード例 #3
0
        public void TestConsumerThread()
        {
            ISHESToComponentsQueues queues        = new SHESToComponentsQueueMock();
            ConsumersList           consumersList = new ConsumersList(ref queues);

            Thread.Sleep(100);
            Request r;

            queues.ConsumersRequest.TryDequeue(out r);

            Assert.IsNotNull(r);
        }
コード例 #4
0
        public void TestBatteryThreadGenerating()
        {
            ISHESToComponentsQueues queues = new SHESToComponentsQueueMock();
            Response response;

            queues.BatteryResponses.TryDequeue(out response);
            queues.BatteryResponses.Enqueue(new Response(0, "test"));

            BatteryList batteryList = new BatteryList(ref queues);

            Assert.IsFalse(batteryList.IsConsumig);
        }