public void Regulate_LowTemp_HeaterIsTurnedOn()
 {
     FakeTempSensor.GenereateTemp = 20;
     uut.Regulate();
     Assert.That(FakeHeater.HeaterIsOn, Is.EqualTo(1));
     //heater.Received(1).TurnOn();
 }
        public static void Main(string[] args)
        {
            var ecs = new ECS(28);

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();

            Console.ReadKey();
        }
Example #3
0
        public static void Main(string[] args)
        {
            var fakeecs = new ECS(25, 28, new FakeTempSensor(), new FakeHeater());

            System.Console.WriteLine(fakeecs.RunSelfTest());

            fakeecs.Regulate();

            fakeecs.SetThreshold(0, 0);

            fakeecs.Regulate();

            System.Console.WriteLine(fakeecs.RunSelfTest());

            System.Console.ReadKey();
        }
Example #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Testing ECS.Legacy");

            // Make an ECS with a threshold of 23
            var control = new ECS(23);

            for (int i = 1; i <= 15; i++)
            {
                Console.WriteLine($"Running regulation number {i}");

                control.Regulate();
            }
        }
Example #5
0
        public static void Main(string[] args)
        {
            var TempSensor = new TempSensor();
            var ecs        = new ECS(20, TempSensor, new Heater());



            TempSensor.setTemp(19);
            ecs.Regulate();
            TempSensor.setTemp(25);
            Console.ReadLine();
            //ecs.Handle;

            // ecs.Regulate();
        }
Example #6
0
 public void Regulate_Below_Threshold_TurnOn_Called_Once()
 {
     temp.Temp = 15;
     uut.Regulate();
     Assert.That(heater.TurnOnCount.Equals(1));
 }
 public void Regulate_Below_Threshold_TurnOn_Called_Once()
 {
     temp.GetTemp().Returns(15);
     uut.Regulate();
     heater.Received(1).TurnOn();
 }