Beispiel #1
0
 public void NullZeroValueList()
 {
     var oldState = new SensorState(_testSensor, DateTime.Now, new Dictionary<DateTime, float>(), null);
     oldState.MakeZero(null, new ChangeReason(0, "Test"));
 }
Beispiel #2
0
        public void SingleValueMadeZero()
        {
            var date = new DateTime(2011, 7, 7, 12, 15, 0);

            var list = new List<DateTime>();
            list.Add(date);

            var oldState = new SensorState(_testSensor, DateTime.Now, new Dictionary<DateTime, float>(), null);
            var newState = oldState.MakeZero(list, new ChangeReason(0, "Test"));

            Assert.AreEqual(0, newState.Values[date]);
        }
Beispiel #3
0
        public void MultipleValuesMadeZero()
        {
            var date = new DateTime(2011, 7, 7, 12, 15, 0);

            var list = new List<DateTime>();
            list.Add(date.AddMinutes(15));
            list.Add(date.AddMinutes(30));
            list.Add(date.AddMinutes(45));

            var oldState = new SensorState(_testSensor, DateTime.Now, new Dictionary<DateTime, float>(), null);
            oldState.Values.Add(date, 5000);

            var newState = oldState.MakeZero(list, new ChangeReason(0, "Test"));

            Assert.AreNotEqual(0, newState.Values[date]);
            Assert.AreEqual(0, newState.Values[list[0]]);
            Assert.AreEqual(0, newState.Values[list[1]]);
            Assert.AreEqual(0, newState.Values[list[2]]);
        }