Ejemplo n.º 1
0
        public void SaveReadingIfValid(GasReading reading)
        {
            if (!_messageIsAccurate(reading))
            {
                return;
            }
            if (_duplicateChecker.MessageIsDuplicate(reading))
            {
                return;
            }

            _duplicateChecker.RecordReadingEventId(reading.EventId);

            PrintReading(reading);

            ReadingsTaken.Add(reading);
        }
Ejemplo n.º 2
0
 public bool MessageIsDuplicate(GasReading reading)
 {
     return(!_processRecord.ContainsKey(reading.EventId));
 }
Ejemplo n.º 3
0
 private static void PrintReading(GasReading reading)
 {
     Console.WriteLine($"{reading.EventId}: locationId = {reading.LocationId}; value = {reading.Value}");
 }