Exemplo n.º 1
0
        static async Task Main(string[] args)
        {
            sw1 = new Stopwatch();
            sw1.Start();
            var consumer = new Common.Consumer(TheCallback);

            consumer.start();
            Console.WriteLine("Hello World!");
            Console.ReadLine();
        }
        public void SetUp()
        {
            num    = 2;
            rezim1 = Enums.ConsumerRezim.ON;
            rezim2 = Enums.ConsumerRezim.OFF;

            cg = new Consumer.ConsumerGUI();

            temp = new Common.Consumer();

            mockConsumer1 = new Mock <Common.Consumer>();
            mockConsumer1.Setup(temp => temp.Id).Returns("0");
            mockConsumer1.Setup(temp => temp.EnergyConsumption).Returns(100);
            mockConsumer1.Setup(temp => temp.Rezim).Returns(rezim1);

            mockConsumer2 = new Mock <Common.Consumer>();
            mockConsumer2.Setup(temp => temp.Id).Returns("1");
            mockConsumer2.Setup(temp => temp.EnergyConsumption).Returns(200);
            mockConsumer2.Setup(temp => temp.Rezim).Returns(rezim2);

            ConsumerSHES.consumersList.Add(mockConsumer1.Object);
            ConsumerSHES.consumersList.Add(mockConsumer2.Object);
        }