public void TestEarthquakeDataFromStartTimeToEndTimeCount() { DateTime fromTime = DateTime.Parse("2016-09-04T04:49:04"); DateTime endTime = DateTime.Parse("2016-09-04T04:49:14"); var earthquakeInstances = EarthquakeDataFeedReader.GetEarthquakeInstances(fromTime, endTime); Assert.IsTrue(earthquakeInstances.Count() > 0); }
void GetLatestEarthquakeInformation() { try { // Request earthquake data from the feed reader. EarthquakeInstances = EarthquakeDataFeedReader.GetEarthquakeInstances(); // Compare the current time with the latest time at which USGS updated their feed data. // Return the later time. Sometimes USGS feed update frequency is lesser than our request // frequency. DateTime currentTime = DateTime.Now.ToUniversalTime(); LatestSyncTime = DateTime.Compare(EarthquakeDataFeedReader.LatestSyncTime, currentTime) > 0 ? EarthquakeDataFeedReader.LatestSyncTime : currentTime; } catch (Exception ex) { throw new Exception("GEM: Unable to obtain latest earthquake information." + Environment.NewLine + ex.Message); } }
public void TestEarthquakeDataInLastTimePeriodCount() { var earthquakeInstances = EarthquakeDataFeedReader.GetEarthquakeInstances(); Assert.IsTrue(earthquakeInstances.Count() > 0); }