Exemplo n.º 1
0
 public void Setup()
 {
     heater = NSubstitute.Substitute.For <IHeater>();
     //tempSensor = NSubstitute.Substitute.For<ITempSensor>();
     fakeTempSensor = new FakeTempSensor();
     uut            = new ECS.Legacy.ECS(_threshold, fakeTempSensor, heater);
 }
Exemplo n.º 2
0
 public void Setup()
 {
     FakeHeater     = new FakeHeater();
     FakeTempSensor = new FakeTempSensor();
     //heater = Substitute.For<IHeater>();
     //uut = new ECS.Legacy.ECS(_threshold, FakeTempSensor, heater);
     uut = new ECS.Legacy.ECS(_threshold, FakeTempSensor, FakeHeater);
 }
        public static void Main(string[] args)
        {
            var ecs = new ECS(28);

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();

            Console.ReadKey();
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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();
        }
Exemplo n.º 6
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();
        }
Exemplo n.º 7
0
 public void Setup()
 {
     uut = new ECS.Legacy.ECS(45, heater, temp);
 }
Exemplo n.º 8
0
 public void Setup()
 {
     heater = NSubstitute.Substitute.For <IHeater>();
     temp   = NSubstitute.Substitute.For <ITempSensor>();
     uut    = new ECS.Legacy.ECS(45, heater, temp);
 }