Ejemplo n.º 1
0
        public void ChangingSetpointWorksRepeatably()
        {
            // this is to check for a bug that manifested when
            // ShiftSubsequentData() was called several times with
            // various values

            IRandomGenerator randomGenerator = new RandomGeneratorStub(0.95);

            var sampleData = new SampleDataGenerator(10, 20, randomGenerator);

            sampleData.GetNextValue();

            sampleData.ShiftSubsequentData(200);

            sampleData.GetNextValue();

            sampleData.ShiftSubsequentData(2000);

            // this one will just be 2000
            sampleData.GetNextValue();

            // this one will likely be different
            var result1 = sampleData.GetNextValue();

            Assert.True(result1 >= 1995);
            Assert.True(result1 <= 2005);

            sampleData.ShiftSubsequentData(-2000);

            // this one will just be -2000
            sampleData.GetNextValue();

            // this one will likely be different
            var result2 = sampleData.GetNextValue();

            Assert.True(result2 >= -2005);
            Assert.True(result2 <= -1995);
        }
Ejemplo n.º 2
0
 public void ChangeSetPointTemperature(double newSetPointTemperature)
 {
     _temperatureGenerator.ShiftSubsequentData(newSetPointTemperature);
 }