/// <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()); }
public Control(IHeater heater, ITempSensor tempSensor, int tempThreshold) { _heater = heater; _tempSensor = tempSensor; _tempThreshold = tempThreshold; }
public void Setup() { _uut = new TempSensor(); }
public void Setup() { fakeTempSensor = new FakeTempSensor(); fakeTempSensorHT = new FakeTempSensorHTThr(); uut = new ECS(thr, new FakeHeaterTrue()); }
public ECS(int thr, ITempSensor sensor, IHeater heater) { SetThreshold(thr); _tempSensor = sensor; _heater = heater; }
public void Setup() { _myHeater = new StubHeater(); _myTempSensor = new StubTempSensor(); _myECS = new EnCoSy(25, _myTempSensor, _myHeater); }
public void GetCurTempReturnsCurTemp(int thr, int temp) { _myTempSensor = new StubTempSensor(temp); _myECS = new EnCoSy(thr, _myTempSensor, _myHeater); Assert.That(_myECS.GetCurTemp(), Is.EqualTo(temp)); }
public void TearDown() { _myECS = null; _myHeater = null; _myTempSensor = null; }
//Constructor Injection public Control(IHeater heater, ITempSensor tempSensor) { //saving references to dependencies _heater = heater; _tempSensor = tempSensor; }
public void Setup() { heater = NSubstitute.Substitute.For <IHeater>(); temp = NSubstitute.Substitute.For <ITempSensor>(); uut = new ECS.Legacy.ECS(45, heater, temp); }
public EECS(int thr, ITempSensor TS, IHeater H) { SetThreshold(thr); _tempSensor = TS; _heater = H; }
public void Setup() { heater = Substitute.For <IHeater>(); tempSensor = Substitute.For <ITempSensor>(); }