private static async Task CheckValuesWrittenASync() { foreach (string streamId in _streamsIdsToSendTo) { try { TemperatureReadings lastVal = await _dataService.GetLastValueAsync <TemperatureReadings>(streamId).ConfigureAwait(false); if (lastVal == null && _toThrow == null) { throw new Exception($"Value for {streamId} was not found"); } } catch (Exception ex) { if (_toThrow == null) { _toThrow = ex; } } } }
private static async Task CheckDeletesValuesAsync() { foreach (string streamId in _streamsIdsToSendTo) { try { TemperatureReadings lastVal = await _dataService.GetLastValueAsync <TemperatureReadings>(streamId).ConfigureAwait(false); if (lastVal != null && _toThrow == null) { throw new Exception($"Value for {streamId} was found"); } } catch (Exception ex) { Console.WriteLine($"Got error in seeing that removed values are gone in {streamId} but continued on:" + ex.Message); if (_toThrow == null) { _toThrow = ex; } } } }