public void SaveReadingIfValid(GasReading reading) { if (!_messageIsAccurate(reading)) { return; } if (_duplicateChecker.MessageIsDuplicate(reading)) { return; } _duplicateChecker.RecordReadingEventId(reading.EventId); PrintReading(reading); ReadingsTaken.Add(reading); }
public bool MessageIsDuplicate(GasReading reading) { return(!_processRecord.ContainsKey(reading.EventId)); }
private static void PrintReading(GasReading reading) { Console.WriteLine($"{reading.EventId}: locationId = {reading.LocationId}; value = {reading.Value}"); }