/// <summary> /// Gets venue model for a certain venue name string /// </summary> /// <param name="venue">Venue to get the model for</param> /// <returns>Venue model</returns> public static VenueModel GetVenueModel(string venue) { if (venues.Keys.Any(x => x == venue.ToUpper().Replace(' ', '_'))) { return venues[venue.ToUpper().Replace(' ', '_')]; } RedisStorage redisStorage = new RedisStorage(); redisStorage.StoreMissingVenue(venue); return null; }
public void WhenCalledItShouldFetchInformationFromAllSources() { RedisStorage storage = new RedisStorage(); storage.PrimeCache(); var redisClient = new RedisClient("localhost"); var eventClient = redisClient.As<EventListModel>(); var all = eventClient.GetAll(); Assert.IsTrue(all.Where(x => x.Id == (int)EventTypes.Movies).Any()); Assert.IsTrue(all.Where(x => x.Id == (int)EventTypes.Sports).Any()); Assert.IsTrue(all.Where(x => x.Id == (int)EventTypes.Concert).Any()); Assert.IsTrue(all.Where(x => x.Id == (int)EventTypes.Theater).Any()); }
/// <summary> /// The prime cache timer elapsed event handler /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">The elapsed event argument</param> private void PrimeCacheTimer_Elapsed(object sender, ElapsedEventArgs e) { RedisStorage storage = new RedisStorage(); storage.PrimeCache(); }