public void GetCurTemp_StubIsSetToX_CurTempIsX(int X)
        {
            StubTempSensor sts = new StubTempSensor(X);

            uut = new ECS(sts, new dummyHeater(), 10);

            int result = uut.GetCurTemp();

            Assert.That(result, Is.EqualTo(X));
        }
        public void RunSelfTest_StubsSetToXandY_ExpectZ(bool X, bool Y, bool Z)
        {
            StubTempSensor sts = new StubTempSensor(0);

            sts.RunSelftestBool = X;
            StubHeater sh = new StubHeater();

            sh.RunSelftestBool = Y;
            uut = new ECS(sts, sh, 10);

            bool result = uut.RunSelfTest();

            Assert.That(result, Is.EqualTo(Z));
        }
Ejemplo n.º 3
0
        public void Regulate_TemperatureOverThreshold_HeaterTurnOnNotCalled(int threshold, int temperature, int onCountResult)
        {
            uut = new ECS(threshold);

            MockHeater     TestHeater = new MockHeater();
            StubTempSensor TestSensor = new StubTempSensor(temperature);

            uut.TempSensor_ = TestSensor;
            uut.Heater_     = TestHeater;

            uut.Regulate();

            Assert.That(onCountResult, Is.EqualTo(TestHeater.TurnOnCount));
        }