/// <summary>
 /// Constructs a DeviceHive temperature sensor for a given sensor object
 /// </summary>
 /// <param name="dev">Parent device</param>
 /// <param name="Code">Equipment code</param>
 /// <param name="sensor">Temperature sensor</param>
 public TempSensor(DeviceEngine dev, string Code, ITempSensor sensor)
     : base(dev)
 {
     Debug.Print("Initializing " + Code + " temperature sensor.");
     name = Code;
     code = Code;
     //equipmentType.name = DeviceTypeName;
     type = DeviceTypeName; //v6
     Sensor = sensor;
     LastTemp = float.MinValue;
     Tolerance = DefaultTolerance;
     Period = DefaultPeriod;
     //Debug.Print("Temperature sensor initialized. Tolerance=" + Tolerance.ToString() + " deg, period=" + (Period / 1000).ToString() + "sec.");
 }
 public void Setup()
 {
     _uut = new ECS(15, _tempSensor = new TempSensor(), _heater = new FakeHeater());
 }
Esempio n. 3
0
 public Control(IHeater heater, ITempSensor tempSensor, int tempThreshold)
 {
     _heater        = heater;
     _tempSensor    = tempSensor;
     _tempThreshold = tempThreshold;
 }
 public void Setup()
 {
     _uut = new TempSensor();
 }
Esempio n. 5
0
 public void Setup()
 {
     fakeTempSensor   = new FakeTempSensor();
     fakeTempSensorHT = new FakeTempSensorHTThr();
     uut = new ECS(thr, new FakeHeaterTrue());
 }
Esempio n. 6
0
 public ECS(int thr, ITempSensor sensor, IHeater heater)
 {
     SetThreshold(thr);
     _tempSensor = sensor;
     _heater     = heater;
 }
Esempio n. 7
0
 public void Setup()
 {
     _myHeater     = new StubHeater();
     _myTempSensor = new StubTempSensor();
     _myECS        = new EnCoSy(25, _myTempSensor, _myHeater);
 }
Esempio n. 8
0
 public void GetCurTempReturnsCurTemp(int thr, int temp)
 {
     _myTempSensor = new StubTempSensor(temp);
     _myECS        = new EnCoSy(thr, _myTempSensor, _myHeater);
     Assert.That(_myECS.GetCurTemp(), Is.EqualTo(temp));
 }
Esempio n. 9
0
 public void TearDown()
 {
     _myECS        = null;
     _myHeater     = null;
     _myTempSensor = null;
 }
Esempio n. 10
0
 //Constructor Injection
 public Control(IHeater heater, ITempSensor tempSensor)
 {
     //saving references to dependencies
     _heater     = heater;
     _tempSensor = tempSensor;
 }
Esempio n. 11
0
 public void Setup()
 {
     heater = NSubstitute.Substitute.For <IHeater>();
     temp   = NSubstitute.Substitute.For <ITempSensor>();
     uut    = new ECS.Legacy.ECS(45, heater, temp);
 }
Esempio n. 12
0
 public EECS(int thr, ITempSensor TS, IHeater H)
 {
     SetThreshold(thr);
     _tempSensor = TS;
     _heater     = H;
 }
Esempio n. 13
0
 public void Setup()
 {
     heater     = Substitute.For <IHeater>();
     tempSensor = Substitute.For <ITempSensor>();
 }